mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-13 20:18:52 +02:00
52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: Go Test
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v6
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
- name: Install gotestsum
|
|
run: go install gotest.tools/gotestsum@latest
|
|
|
|
- name: Setup test environment
|
|
run: |
|
|
go build -tags encoder_setup -o encoder-setup ./cmd/encoder-setup
|
|
./encoder-setup
|
|
|
|
- name: Run tests
|
|
run: |
|
|
mkdir -p test-results
|
|
gotestsum --junitfile test-results/junit.xml --format testname -- -race -coverprofile=coverage.txt -covermode=atomic ./...
|
|
|
|
- name: Upload test result artifact
|
|
if: ${{ !cancelled() }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: test-results
|
|
path: |
|
|
test-results/junit.xml
|
|
test-results/coverage.txt
|
|
retention-days: 7
|
|
- name: Upload test results to Codecov
|
|
if: ${{ !cancelled() }}
|
|
uses: codecov/test-results-action@v1
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: test-results/junit.xml
|
|
- name: Upload coverage reports to Codecov
|
|
if: ${{ !cancelled() }}
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|