Merge pull request #1 from PragmaticEngineering/updating-workflow #7
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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Go | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [ '1.21', '1.22' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Get official govulncheck | |
run: go install golang.org/x/vuln/cmd/govulncheck@latest | |
shell: bash | |
- name: Run govulncheck | |
run: govulncheck ./... | |
shell: bash | |
- name: Test with Go | |
run: go test ./... -json > TestResults-${{ matrix.go-version }}.json | |
- name: Upload Go test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Go-results-${{ matrix.go-version }} | |
path: TestResults-${{ matrix.go-version }}.json |