Merge pull request #185 from emmansun/dependabot/go_modules/golang.or… #618
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: ci | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goVer: ['1.18', '1.19', '1.21'] | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.goVer }} | |
- name: Test with Coverage | |
if: ${{ matrix.goVer == '1.18' }} | |
run: go test -coverpkg=./... -v -short -coverprofile=coverage1.txt -covermode=atomic ./... | |
env: | |
GODEBUG: x509sha1=1 | |
- name: Test Generic with Coverage | |
if: ${{ matrix.goVer == '1.18' }} | |
run: go test -coverpkg=./... -v -short -tags purego -coverprofile=coverage2.txt -covermode=atomic ./... | |
env: | |
GODEBUG: x509sha1=1 | |
- name: Upload coverage to Codecov | |
if: ${{ matrix.goVer == '1.18' }} | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ./coverage1.txt,./coverage2.txt | |
- name: Test only | |
if: ${{ matrix.goVer != '1.18' }} | |
run: go test -short ./... | |
env: | |
GODEBUG: x509sha1=1 | |
- name: Test Generic only | |
if: ${{ matrix.goVer != '1.18' }} | |
run: go test -short -tags purego ./... | |
env: | |
GODEBUG: x509sha1=1 | |
- name: Test Plugin only | |
if: ${{ matrix.goVer != '1.18' }} | |
run: go test -short -tags plugin ./... | |
env: | |
GODEBUG: x509sha1=1 |