Skip to content

Breaking: new RoAST representation of module.comments #4660

Breaking: new RoAST representation of module.comments

Breaking: new RoAST representation of module.comments #4660

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:
# needed for checks in merge queue
merge_group:
permissions: read-all
jobs:
build-matrix:
env:
RQ_VERSION: v0.0.15
name: Matrix
strategy:
matrix:
os:
- runner: ubuntu-latest
name: linux
static: true
- runner: macos-15-intel
name: macos-intel
static: false
- runner: macos-26
name: macos-arm64
static: true
- runner: windows-latest
name: windows
static: true
runs-on: ${{ matrix.os.runner }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
- uses: open-policy-agent/setup-opa@b2b258e089860efaadaaf71bf6e3aecb4a3eeff1 # v2.4.0
with:
version: edge
static: ${{ matrix.os.static }}
- run: npm ci
working-directory: build
- name: Restore rq cache
id: cache-rq
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
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@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ~/go/bin/rq
key: ${{ runner.os }}-${{ runner.arch }}-go-rq-${{ env.RQ_VERSION }}
- run: build/do.rq pull_request
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
if: matrix.os.name == 'linux'
with:
version: v2.10.1
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: regal-${{ matrix.os.name }}
path: regal
race_detector:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
- run: go test -race ./...
id: race
continue-on-error: true
- run: echo "race detector failed but job is optional"
if: job.steps.race.status == failure()
frankenstein:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
- run: |
go mod tidy
working-directory: e2e/testbuild
- name: display go.sum diff
working-directory: e2e/testbuild
run: |
git diff --exit-code go.sum && exit 0
echo "# go.sum diff" >> $GITHUB_STEP_SUMMARY
echo '```diff' >> $GITHUB_STEP_SUMMARY
git diff go.sum >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- run: |
go run .
working-directory: e2e/testbuild
code_coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
- uses: open-policy-agent/setup-opa@b2b258e089860efaadaaf71bf6e3aecb4a3eeff1 # v2.4.0
with:
version: edge
static: true
- 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@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
fail_ci_if_error: false
files: ./coverage.json
name: regal
token: ${{ secrets.CODECOV_TOKEN }} # required