1010 - cron : ' 0 0 * * 0' # Run weekly on Sundays at midnight UTC
1111
1212jobs :
13- build :
14- name : Build
13+ build-and-test :
14+ name : Build and Test
1515 runs-on : ubuntu-latest
1616 timeout-minutes : 10 # Add timeout to prevent hanging jobs
1717
3333 - name : Build
3434 run : go build -v ./cmd/stremax
3535
36- - name : Upload binary
37- uses : actions/upload-artifact@v2 # Use v2 for compatibility
38- with :
39- name : stremax-binary
40- path : ./stremax
41- retention-days : 1
42-
43- test :
44- name : Test
45- runs-on : ubuntu-latest
46- timeout-minutes : 10
47-
48- steps :
49- - name : Checkout code
50- uses : actions/checkout@v3
51-
52- - name : Create empty go.sum if it doesn't exist
53- run : touch go.sum
54-
55- - name : Set up Go
56- uses : actions/setup-go@v3
57- with :
58- go-version : 1.19
59- cache : true # Enable cache now that we have a go.sum file
60-
6136 - name : Run unit tests
6237 run : go test -v ./...
6338
@@ -67,12 +42,24 @@ jobs:
6742 - name : Run tests with coverage
6843 run : go test -coverprofile=coverage.out -covermode=atomic ./...
6944
70- - name : Upload coverage report
71- uses : actions/upload-artifact@v2 # Use v2 for compatibility
72- with :
73- name : coverage-report
74- path : ./coverage.out
75- retention-days : 1
45+ - name : Display coverage
46+ run : go tool cover -func=coverage.out
47+
48+ - name : Run example programs
49+ run : |
50+ chmod +x ./stremax
51+ ./stremax run -file ./examples/simple.sx
52+ ./stremax run -file ./examples/arithmetic.sx
53+ ./stremax run -file ./examples/strings.sx
54+ ./stremax run -file ./examples/conditionals.sx
55+ ./stremax run -file ./examples/boolean.sx
56+ ./stremax run -file ./examples/combined.sx
57+
58+ - name : Run benchmarks
59+ run : go test -bench=. -benchmem ./... > benchmark-result.txt
60+
61+ - name : Display benchmark results
62+ run : cat benchmark-result.txt
7663
7764 lint :
7865 name : Lint
@@ -108,60 +95,4 @@ jobs:
10895 run : $(go env GOPATH)/bin/golint -set_exit_status ./...
10996
11097 - name : Run go vet
111- run : go vet ./...
112-
113- integration :
114- name : Integration Tests
115- runs-on : ubuntu-latest
116- timeout-minutes : 5
117- needs : build
118-
119- steps :
120- - name : Checkout code
121- uses : actions/checkout@v3
122-
123- - name : Download binary
124- uses : actions/download-artifact@v2 # Use v2 for compatibility
125- with :
126- name : stremax-binary
127- path : .
128-
129- - name : Make binary executable
130- run : chmod +x ./stremax
131-
132- - name : Run example programs
133- run : |
134- ./stremax run -file ./examples/simple.sx
135- ./stremax run -file ./examples/arithmetic.sx
136- ./stremax run -file ./examples/strings.sx
137- ./stremax run -file ./examples/conditionals.sx
138- ./stremax run -file ./examples/boolean.sx
139- ./stremax run -file ./examples/combined.sx
140-
141- benchmark :
142- name : Benchmarks
143- runs-on : ubuntu-latest
144- timeout-minutes : 5
145-
146- steps :
147- - name : Checkout code
148- uses : actions/checkout@v3
149-
150- - name : Create empty go.sum if it doesn't exist
151- run : touch go.sum
152-
153- - name : Set up Go
154- uses : actions/setup-go@v3
155- with :
156- go-version : 1.19
157- cache : true # Enable cache now that we have a go.sum file
158-
159- - name : Run benchmarks
160- run : go test -bench=. -benchmem ./... > benchmark-result.txt
161-
162- - name : Upload benchmark results
163- uses : actions/upload-artifact@v2 # Use v2 for compatibility
164- with :
165- name : benchmark-results
166- path : ./benchmark-result.txt
167- retention-days : 7
98+ run : go vet ./...
0 commit comments