Skip to content

Commit

Permalink
fix: permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Eyo Chen committed May 14, 2024
1 parent a0d8205 commit 81fffa6
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ on:
branches:
- 'main'

permissions:
contents: write
pull-requests: write

jobs:
full_ci:
strategy:
matrix:
go_version: [ 1.23.x ]
go_version: [1.23.x]

runs-on: ubuntu-20.04

Expand All @@ -20,28 +24,26 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.4

- name: Install gocover-cobertura
run: |
go get github.com/boumenot/gocover-cobertura && go install github.com/boumenot/gocover-cobertura
go get github.com/boumenot/gocover-cobertura && go install github.com/boumenot/gocover-cobertura
# Install gotestfmt on the VM running the action.
- name: Set up gotestfmt
uses: GoTestTools/gotestfmt-action@v2
with:
# Optional: pass the gotestfmt version you want to run.
version: v2.0.0
# Optional: pass an organization name and repo to use a fork
org: GoTestTools
repo: gotestfmt

- name: Run tests
run: sudo go test -race -json -v -coverprofile=coverage.txt ./... 2>&1 | tee /tmp/gotest.log | gotestfmt

- name: Convert go coverage to corbetura format
run: gocover-cobertura < coverage.txt > coverage.xml

Expand All @@ -51,7 +53,7 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.xml

- name: Generate code coverage report
uses: irongut/CodeCoverageSummary@v1.3.0
with:
Expand All @@ -70,4 +72,4 @@ jobs:
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md
path: code-coverage-results.md

0 comments on commit 81fffa6

Please sign in to comment.