Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaydubina committed Aug 22, 2024
1 parent ac01422 commit 56f6fb9
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,40 @@ name: Test

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [main]

permissions: read-all

jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.18
id: go

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

- name: Get dependencies
run: go get -v -t -d ./...

- name: Test
run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.txt
verbose: true
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.16
id: go

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

- name: Test
run: |
go get -v -t -d ./...
go install github.com/jstemmer/go-junit-report/v2@latest
go test -coverprofile=coverage.out -covermode=atomic -cover -json -v ./... 2>&1 | go-junit-report -set-exit-code > tests.xml
- name: Upload test results to Codecov
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: tests.xml

- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.out

0 comments on commit 56f6fb9

Please sign in to comment.