Skip to content

Simplify CI workflow to avoid artifact upload issues #7

Simplify CI workflow to avoid artifact upload issues

Simplify CI workflow to avoid artifact upload issues #7

Workflow file for this run

name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch: # Allow manual triggering
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.19, 1.20, 1.21]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: go mod download
- name: Run unit tests
run: go test -v ./...
- name: Run tests with race detection
run: go test -race -v ./...
- name: Run tests with coverage
run: go test -coverprofile=coverage.out -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.out
fail_ci_if_error: false
integration-test:
name: Integration Tests
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Build
run: go build -v -o stremax ./cmd/stremax
- name: Run example programs
run: |
./stremax run -file ./examples/simple.sx
./stremax run -file ./examples/arithmetic.sx
./stremax run -file ./examples/strings.sx
./stremax run -file ./examples/conditionals.sx
./stremax run -file ./examples/boolean.sx
./stremax run -file ./examples/combined.sx
# Skip examples that are expected to fail
# ./stremax run -file ./examples/errors.sx
benchmark:
name: Benchmarks
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Run benchmarks
run: go test -bench=. -benchmem ./...