Merge pull request #3 from qiniu/upgrades/0.1.1 #9
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: tests | |
on: [push, pull_request] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
go-version: [1.21.x] | |
include: | |
- go-version: 1.20.x | |
os: ubuntu-latest | |
- go-version: 1.19.x | |
os: ubuntu-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
- name: Format | |
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi | |
- name: Golint | |
run: | | |
set -e | |
go install honnef.co/go/tools/cmd/staticcheck@latest | |
staticcheck -go 1.19 ./... | |
- name: Run Tests | |
run: | | |
set -e | |
go test -v ./... | |
shell: bash |