Updating our go version #11
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
name: "Build/Tests" | |
on: | |
push: | |
branches: | |
- master | |
- main | |
- 'release/**' | |
pull_request: | |
concurrency: | |
group: ci-${{ github.ref }}-tests | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Install Go | |
uses: actions/[email protected] | |
with: | |
go-version: '1.19.5' | |
- uses: actions/[email protected] | |
id: cache | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Build | |
env: | |
DRAND_TEST_LOGS: "${{ runner.debug == '1' && 'DEBUG' || 'INFO' }}" | |
run: | | |
export PATH=$PATH:$(go env GOPATH)/bin | |
make db-migration | |
test: | |
runs-on: ubuntu-latest | |
env: | |
CI: "true" | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
go-version: '1.19.5' | |
- uses: actions/[email protected] | |
id: cache | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- run: go get -v -t -d ./... | |
- name: Unit tests | |
env: | |
DRAND_TEST_LOGS: "${{ runner.debug == '1' && 'DEBUG' || 'INFO' }}" | |
run: make test-unit | |
- name: Integration tests | |
env: | |
DRAND_TEST_LOGS: "${{ runner.debug == '1' && 'DEBUG' || 'INFO' }}" | |
run: make test-integration | |
coverage: | |
runs-on: ubuntu-latest | |
env: | |
CI: "true" | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- uses: actions/[email protected] | |
with: | |
go-version: '1.19.5' | |
- uses: actions/[email protected] | |
id: cache | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- run: make coverage | |
env: | |
DRAND_TEST_LOGS: "${{ runner.debug == '1' && 'DEBUG' || 'INFO' }}" | |
- run: bash <(curl -s https://codecov.io/bash) |