Skip to content

Modernizes the CI workflow. #43

Modernizes the CI workflow.

Modernizes the CI workflow. #43

Workflow file for this run

name: Test
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
test:
name: Tests on ${{ matrix.go-version }} ${{ matrix.platform }}
strategy:
matrix:
os: [darwin, linux]
arch: [x86_64, arm64]
go-version:
# Check the earliest and two trailing versions, to keep
# maintainance of this file reasonable.
- 1.17
- oldstable
- stable
include:
- os: linux
platform: ubuntu-latest
- os: darwin
platform: macos-latest
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Add GOPATH to GITHUB_ENV
run: echo "GOPATH=$(go env GOPATH)" >>"$GITHUB_ENV"
- name: Checkout
uses: actions/checkout@v4
- name: Run Tests With Coverage
run: go test -v -coverprofile coverage.out ./...
env:
CGO_CXXFLAGS: "-Werror"
- name: Upload Coverage To Codecov
uses: codecov/codecov-action@v3
if: ${{ secrets.CODECOV_TOKEN }} != ''

Check failure on line 48 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / Test

Invalid workflow file

The workflow is not valid. .github/workflows/test.yml (Line: 48, Col: 11): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.CODECOV_TOKEN
env:
OS: ${{ matrix.os }}
ARCH: ${{ matrix.arch }}
PLATFORM: ${{ matrix.platform }}
GO: ${{ matrix.go-version }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
flags: unittests
fail_ci_if_error: true
env_vars: OS,ARCH,PLATFORM,GO
- name: Scan and Upload FOSSA Data
if: env.FOSSA_API_KEY != '' && github.ref == 'refs/heads/master'
run: |
curl https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash
fossa analyze
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}