Skip to content

Commit

Permalink
update tests.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bmoffatt committed Nov 30, 2023
1 parent d2f63b8 commit a66fa3d
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
strategy:
matrix:
go:
- "1.21"
- "1.20"
- "1.19"
- "1.18"
Expand All @@ -24,34 +25,38 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- run: go version

- name: install lambda runtime interface emulator
run: curl -L -o /usr/local/bin/aws-lambda-rie https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-x86_64
- run: chmod +x /usr/local/bin/aws-lambda-rie
- run: chmod +x /usr/local/bin/aws-lambda-rie

- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: modhack
run: if [[ ${{ matrix.go }} < "1.15" ]]; then sed -i.bak 's/.*retract .*//' go.mod; fi
- name: Edit the go.mod file to allow tests to run for versions of go before 1.16
run: if [[ ${{ matrix.go }} < "1.16" ]]; then sed -i.bak 's/^.*retract.*$//' go.mod; fi

- name: go test
run: go test -v -race ./...

coverage:
name: run tests with coverage
runs-on: ubuntu-latest
strategy:
matrix:
go:
- "1.21"
steps:
- name: Set up Go
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: "1.20"
go-version: ${{ matrix.go }}

- name: install lambda runtime interface emulator
run: curl -L -o /usr/local/bin/aws-lambda-rie https://github.com/aws/aws-lambda-runtime-interface-emulator/releases/latest/download/aws-lambda-rie-x86_64
- run: chmod +x /usr/local/bin/aws-lambda-rie
- run: chmod +x /usr/local/bin/aws-lambda-rie

- name: Check out code into the Go module directory
uses: actions/checkout@v3
Expand All @@ -65,5 +70,5 @@ jobs:
file: ./coverage.txt
env_vars: GO
env:
GO: "1.20"
GO: ${{ matrix.go }}

0 comments on commit a66fa3d

Please sign in to comment.