-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Sebastien Binet <[email protected]>
- Loading branch information
1 parent
7197359
commit 2ae9328
Showing
1 changed file
with
38 additions
and
52 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 |
---|---|---|
|
@@ -2,68 +2,54 @@ name: CI | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [main] | ||
pull_request: | ||
branches: [ main ] | ||
branches: [main] | ||
|
||
env: | ||
GOPROXY: "https://proxy.golang.org" | ||
GO111MODULE: "on" | ||
TAGS: "-tags=czmq4" | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build | ||
main: | ||
strategy: | ||
matrix: | ||
go-version: [1.18.x, 1.17.x] | ||
platform: [ubuntu-latest] | ||
#platform: [ubuntu-latest, macos-latest, windows-latest] | ||
go-version: [1.19.x, 1.18.x] | ||
|
||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
cache: true | ||
|
||
- name: Install Linux packages | ||
if: matrix.platform == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update -qq -y | ||
sudo apt-get install -y libsodium-dev libczmq-dev | ||
- name: go install | ||
run: GOARCH=amd64 go install -v $TAGS ./... | ||
|
||
- name: Test Linux | ||
run: ./.ci/code-coverage.sh | ||
|
||
- name: Verify code formatting | ||
run: | | ||
test -z $(gofmt -l .) | ||
- name: Cache-Go | ||
uses: actions/cache@v3 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
'%LocalAppData%\go-build' | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
- name: Run linter | ||
uses: dominikh/staticcheck-action@v1 | ||
with: | ||
install-go: false | ||
cache-key: ${{ matrix.platform }} | ||
version: "2022.1" | ||
|
||
- name: Install Linux packages | ||
if: matrix.platform == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get update -qq -y | ||
sudo apt-get install -y libsodium-dev libczmq-dev | ||
- name: Build-Linux-64b | ||
run: | | ||
GOARCH=amd64 go install -v $TAGS ./... | ||
- name: Test Linux | ||
run: | | ||
./.ci/code-coverage.sh | ||
- name: static-check | ||
uses: dominikh/[email protected] | ||
with: | ||
install-go: false | ||
cache-key: ${{ matrix.platform }} | ||
version: "2022.1" | ||
- name: Upload-Coverage | ||
uses: codecov/codecov-action@v1 | ||
- name: Upload code coverage | ||
uses: codecov/codecov-action@v1 |