Skip to content

Commit

Permalink
Add codecov as github action, set permissions to read content only
Browse files Browse the repository at this point in the history
Signed-off-by: Kenny Leung <[email protected]>
  • Loading branch information
k4leung4 committed Mar 1, 2022
1 parent 3a81b51 commit cbeb3c5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ env:
jobs:
unit-tests:
name: Run unit tests
permissions:
contents: read
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
env:
OS: ${{ matrix.os }}

steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 #v2.4.0
Expand All @@ -55,7 +59,11 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
- name: Run Go tests
run: go test ./...
run: go test -covermode=atomic -coverprofile=coverage.txt ./...
- name: Upload Coverage Report
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
env_vars: OS
- name: Run Go tests w/ `-race`
if: ${{ runner.os == 'Linux' }}
run: go test -race ./...
Expand Down

0 comments on commit cbeb3c5

Please sign in to comment.