Skip to content

Support fallback to no-CGO implementation if cgo is disabled. #52

Support fallback to no-CGO implementation if cgo is disabled.

Support fallback to no-CGO implementation if cgo is disabled. #52

Workflow file for this run

on: [push, pull_request]
name: Test
jobs:
test:
strategy:
matrix:
go-version: [1.23.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: go test -short -v ./... -coverpkg "github.com/prequel-dev/plz4,github.com/prequel-dev/plz4/internal/...,github.com/prequel-dev/plz4/pkg/..." -coverprofile coverage.out
- name: Upload coverage as artifact
uses: actions/upload-artifact@v4
with:
name: coverage.out
path: coverage.out
if: matrix.os == 'ubuntu-latest'
coverage:
runs-on: ubuntu-latest
needs: test
permissions:
contents: write # This grants write access to the repository, including the Wiki.
steps:
- name: Download coverage artifact
uses: actions/download-artifact@v4
with:
name: coverage.out
path: ~/coverage.out
- name: Update coverage report
uses: ncruces/go-coverage-report@v0
with:
report: 'true'
chart: 'true'
amend: 'true'
coverage-file: 'coverage.out'
continue-on-error: true