-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use GitHub Actions to also run the tests on Windows and Mac
- Loading branch information
1 parent
f807163
commit 20858db
Showing
2 changed files
with
70 additions
and
23 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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
# Default is true, cancels jobs for other platforms in the matrix if one fails | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest, windows-latest ] | ||
go: [ '1.15' ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Print Go version and environment | ||
id: vars | ||
run: | | ||
printf "Using go at: $(which go)\n" | ||
printf "Go version: $(go version)\n" | ||
printf "\n\nGo environment:\n\n" | ||
go env | ||
printf "\n\nSystem environment:\n\n" | ||
env | ||
# Calculate the short SHA1 hash of the git commit | ||
echo "::set-output name=short_sha::$(git rev-parse --short HEAD)" | ||
echo "::set-output name=go_cache::$(go env GOCACHE)" | ||
- name: Cache the build cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.vars.outputs.go_cache }} | ||
key: ${{ runner.os }}-${{ matrix.go }}-go-ci-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.go }}-go-ci | ||
- name: Install dependencies | ||
run: | | ||
go mod download | ||
- name: Run tests | ||
run: | | ||
./cover.sh $HOME/build coverage.out | ||
- uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
path-to-profile: coverage.out | ||
|
||
golangci: | ||
name: Lint | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.31 |
This file was deleted.
Oops, something went wrong.