-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build scripts, fix windows test issues (#11)
- Update rakefile and workflows (from maargnton/go-testreport) - Upload coverage file on linux runner, latest go only - Fix build badge in README.md - Fix Ruby STDOUT buffering on windows - Disable `-race` option when running tests on windows - Use proper shell escaping.for `git describe` on windows - Remove extra leading space in `git unshallow` command
- Loading branch information
1 parent
1adf00a
commit 2090d7e
Showing
4 changed files
with
264 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,48 @@ | ||
name: build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
name: Tests | ||
build: | ||
name: Build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go: | ||
- "1.17.x" | ||
- "1.18.x" | ||
- 1.17.x | ||
- 1.18.x | ||
- 1.19.x | ||
- 1.20.x | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
- macos-12 | ||
- windows-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: "2.5" | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Check version | ||
run: go version | ||
|
||
- name: Run tests with coverage | ||
if: matrix.os != 'windows-latest' | ||
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... | ||
|
||
- name: Run tests without coverage (windows) | ||
if: matrix.os == 'windows-latest' | ||
run: go test -race ./... | ||
- name: Test and build package | ||
run: rake --trace build | ||
|
||
- name: Upload coverage | ||
if: matrix.os != 'windows-latest' | ||
uses: codecov/codecov-action@v2 | ||
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.20.x' | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
# fail_ci_if_error: true | ||
verbose: true | ||
flags: unittests | ||
file: coverage.txt | ||
file: build/go-test-coverage.txt | ||
|
||
- name: Archive action artifacts | ||
if: always() # Always run step even if other steps fail | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.os }}-${{ matrix.go }} | ||
path: | | ||
build/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.