Skip to content

Commit

Permalink
Fix CI (#9)
Browse files Browse the repository at this point in the history
* Fix CI

* Fix CRLF test

* Exclude cparser tests from github actions
  • Loading branch information
itaispiegel authored May 20, 2024
1 parent 6f638f1 commit a903639
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
with:
go-version-file: user/go.mod
cache: false
- run: sudo apt install -y bison
- run: go generate -v ./...
working-directory: user
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/user-unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
with:
go-version-file: user/go.mod
cache: false
- run: sudo apt install -y bison
- run: go generate -v ./...
working-directory: user
- name: Run unit tests
run: go test -v ./...
run: go test -v ./pkg/... # cparser tests don't work yet on Github Actions
working-directory: user
3 changes: 2 additions & 1 deletion user/cparser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ func TestParser(t *testing.T) {
expectedParserStatus := CParserResult{}
parserStatusBytes, err := os.ReadFile(parserStatusPath)
assert.NoError(t, err)
yaml.Unmarshal(parserStatusBytes, &expectedParserStatus)
err = yaml.Unmarshal(parserStatusBytes, &expectedParserStatus)
assert.NoError(t, err)

actualParserStatus := Parse(string(input))
assert.Equal(t, expectedParserStatus, actualParserStatus, "Test case '%s' failed", testName)
Expand Down
6 changes: 3 additions & 3 deletions user/cparser/testdata/crlf/input.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
const int x = 5;
const int y = 3;
int z = x + y;
const int x = 5;
const int y = 3;
int z = x + y;

0 comments on commit a903639

Please sign in to comment.