Skip to content

Commit

Permalink
ci: streamline github actions
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastien Binet <[email protected]>
  • Loading branch information
bartekpacia and sbinet authored Nov 9, 2022
1 parent 7197359 commit 2ae9328
Showing 1 changed file with 38 additions and 52 deletions.
90 changes: 38 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2ae9328

Please sign in to comment.