Skip to content

linter: use a buffered error channel #2557

linter: use a buffered error channel

linter: use a buffered error channel #2557

Workflow file for this run

name: Build
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions: read-all
jobs:
build-matrix:
env:
RQ_VERSION: v0.0.9
name: Matrix
strategy:
matrix:
os:
- runner: ubuntu-latest
name: linux
static: true
- runner: macos-13
name: macos-intel
static: false
- runner: macos-14
name: macos-arm64
static: true
runs-on: ${{ matrix.os.runner }}
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
- uses: open-policy-agent/setup-opa@34a30e8a924d1b03ce2cf7abe97250bbb1f332b5 # v2.2.0
with:
version: v0.69.0
static: ${{ matrix.os.static }}
- run: npm install --prefix build
- name: Restore rq cache
id: cache-rq
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
with:
path: ~/go/bin/rq
key: ${{ runner.os }}-${{ runner.arch }}-go-rq-${{ env.RQ_VERSION }}
- run: go install git.sr.ht/~charles/rq/cmd/rq@${{ env.RQ_VERSION }}
if: steps.cache-rq.outputs.cache-hit != 'true'
- name: Cache rq binary
if: steps.cache-rq.outputs.cache-hit != 'true'
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
with:
path: ~/go/bin/rq
key: ${{ runner.os }}-${{ runner.arch }}-go-rq-${{ env.RQ_VERSION }}
- run: build/do.rq pull_request
- run: go test -race ./...
if: matrix.os.name == 'linux'
- uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
if: matrix.os.name == 'linux'
with:
version: v1.60.3
- uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
with:
name: regal-${{ matrix.os.name }}
path: regal
code_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
- uses: open-policy-agent/setup-opa@34a30e8a924d1b03ce2cf7abe97250bbb1f332b5 # v2.2.0
with:
version: v0.69.0
- run: |
go run main.go test --coverage bundle \
| opa eval -f raw -I -d build/simplecov/simplecov.rego data.build.simplecov.from_opa \
> coverage.json
- uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0
with:
fail_ci_if_error: false
files: ./coverage.json
name: regal
token: ${{ secrets.CODECOV_TOKEN }} # required