Skip to content

ci: run unit tests on supported os runners #1673

ci: run unit tests on supported os runners

ci: run unit tests on supported os runners #1673

Workflow file for this run

name: Lint -> Test
on:
push:
branches: [main]
pull_request:
# Since no branch is specified, this will run on all PRs
# Repository dispatches are triggered throughout the GitHub API. This is used to run the custom integration tests using a specified API host
# in the custom integration test job below
repository_dispatch:
types: [run_integration_tests]
workflow_dispatch:
jobs:
lint-test:
name: Lints and Tests
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.26.1"
- name: Lint
if: runner.os == 'Linux'
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: latest
args: --timeout=5m
- name: Unit Tests
if: runner.os == 'Linux'
run: make test
- name: Unit Tests
if: runner.os != 'Linux'
run: go test -v ./... -race -covermode=atomic -coverprofile=coverage.out
shell: bash
- name: Install Tests
if: runner.os != 'Windows'
run: make test-install
- name: Upload coverage to Codecov
if: runner.os == 'Linux'
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
fail_ci_if_error: false
# Monitor code coverage and TODO/FIXME-type comments
health-score:
name: Health Score
needs: lint-test
runs-on: macos-latest
permissions:
checks: write
contents: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: "1.26.1"
- name: Report health score
uses: slackapi/slack-health-score@d58a419f15cdaff97e9aa7f09f95772830ab66f7 # v0.1.1
with:
extension: "go"
codecov_token: ${{ secrets.ELAINES_CODECOV_API_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
include: "cmd internal"