40 lines
851 B
YAML
40 lines
851 B
YAML
name: Go
|
|
on: [ push, pull_request ]
|
|
jobs:
|
|
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# match the minimum supported and the latest Go versions
|
|
go_version: [ '1.20', '^1.20' ]
|
|
|
|
steps:
|
|
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: ${{ matrix.go_version }}
|
|
check-latest: true
|
|
|
|
- name: Test
|
|
run: go test ./...
|
|
|
|
- run: mkdir -p ./bin/tools
|
|
|
|
- name: Build tools
|
|
run: go build -o ./bin/tools ./examples/...
|
|
|
|
- name: Upload tools
|
|
if: ${{ startsWith(matrix.go_version, '^') }}
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: tools
|
|
path: ./bin/tools
|