mirror of
https://github.com/jwetzell/psn-go.git
synced 2026-08-28 18:39:18 +00:00
add codecov
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
name: Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v7
|
||||
with:
|
||||
go-version-file: "./go.mod"
|
||||
- name: Run tests
|
||||
run: go test -coverprofile=coverage.txt ./...
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v7
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
files: coverage.txt
|
||||
@@ -1,31 +0,0 @@
|
||||
name: "Test Decoders"
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
paths:
|
||||
- 'internal/decoders/**'
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
test_decoders:
|
||||
name: "test decoders"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version-file: "./go.mod"
|
||||
|
||||
- name: Test
|
||||
run: go test -cover -coverprofile=decoders_coverage.txt ./internal/decoders/...
|
||||
|
||||
- name: Archive code coverage results
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: decoders-code-coverage
|
||||
path: decoders_coverage.txt
|
||||
@@ -1,31 +0,0 @@
|
||||
name: "Test Encoders"
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
paths:
|
||||
- 'internal/encoders/**'
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
|
||||
jobs:
|
||||
test_encoders:
|
||||
name: "test encoders"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version-file: "./go.mod"
|
||||
|
||||
- name: Test
|
||||
run: go test -cover -coverprofile=encoders_coverage.txt ./internal/encoders/...
|
||||
|
||||
- name: Archive code coverage results
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: encoders-code-coverage
|
||||
path: encoders_coverage.txt
|
||||
Reference in New Issue
Block a user