⬇️ Decreasing go version in go mod file #102
Workflow file for this run
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: go | |
# Controls when the workflows will run | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
# The 'test' job runs all the go tests | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Setup Go environment | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' | |
- name: Test | |
run: go test -v -count=1 -timeout=10s ./... | |
# The 'test_os' job runs all the go tests against different oses and different go versions | |
test_os: | |
strategy: | |
matrix: | |
os: ['ubuntu-22.04'] #, 'ubuntu-20.04'] | |
go-version: [ | |
#'1.5', '1.6', '1.7', '1.8', '1.9', | |
#'1.10', '1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', | |
'1.5','1.18', '1.20', '1.21' | |
] | |
name: test go${{ matrix.go-version }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Setup Go environment | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Remove examples | |
run: rm -r ./examples | |
- name: Test | |
run: go test -v -count=1 -timeout=10s ./... | |
# The 'examples' package builds all the examples | |
examples: | |
name: examples | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Setup Go environment | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' | |
- name: Change to examples module | |
run: cd ./examples | |
- name: Build examples | |
working-directory: ./examples | |
run: go build -v -o ./outputs/ ./... | |
# The 'lint' job runs the linter | |
golangci: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Setup Go environment | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' | |
# Equivalent of locally running the command 'golangci-lint run' | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.51.2 |