Skip to content

Commit

Permalink
ci: Improve GitHub actions across platforms
Browse files Browse the repository at this point in the history
- Improve Windows compatibility in build workflow
- Optimize unit testing for pull requests
- Upgrade Coveralls GitHub action to v2 for improved coverage tracking
  • Loading branch information
moonD4rk committed Jan 12, 2024
1 parent 2578193 commit ee156d2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,21 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Format
run: diff -u <(echo -n) <(gofmt -d .)
- name: Format Check
if: matrix.os == 'windows-latest'
run: |
$files = gofmt -l .
if ($files) {
Write-Output "Unformatted files:"
Write-Output $files
exit 1
}
shell: pwsh

- name: Format Check
if: matrix.os != 'windows-latest'
run: |
diff -u <(echo -n) <(gofmt -d .)
- name: Get dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
on:
[push, pull_request]
[pull_request]

name: run tests
jobs:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Convert coverage.out to coverage.lcov
uses: jandelgado/gcov2lcov-action@v1
- name: Coveralls
uses: coverallsapp/github-action@v1.1.2
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov

0 comments on commit ee156d2

Please sign in to comment.