Skip to content

ci(superlint): fix workflow #45

ci(superlint): fix workflow

ci(superlint): fix workflow #45

Workflow file for this run

name: "Testing"
on:
workflow_dispatch:
push:
branches:
- "**"
pull_request:
branches:
- "**"
permissions:
contents: write
pull-requests: write
defaults:
run:
shell: bash
concurrency:
group: "${{ github.workflow }}@${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
test:
name: Test
needs: [lint]
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
env:
CACHE_PATH: ${{ matrix.os == 'macos-latest' && '/private/var/tmp/_bazel_runner/' || '~/.cache/bazel' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Bazel
uses: bazel-contrib/setup-bazel@0.8.5
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}
repository-cache: true
- name: Cache Bazel
uses: actions/cache@v4
with:
path: ${{ env.CACHE_PATH }}
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'WORKSPACE', 'MODULE.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-
- name: Build Bazel artifacts
run: |
bazel --output_user_root=${{ env.CACHE_PATH }} build //...
- name: Test Bazel artifacts
run: |
bazel --output_user_root=${{ env.CACHE_PATH }} test //...
dispatch:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
needs: [test]
steps:
- name: Dispatch a release workflow run
if: ${{ always() && contains(join(needs.*.result, ','), 'success') }} # ref: https://github.com/actions/runner/issues/1251
uses: actions/github-script@v7
with:
github-token: "${{ env.GITHUB_TOKEN }}"
script: |
const payload = {
run_id: "${{ github.run_id }}",
sha: "${{ github.sha }}"
}
console.log("Sending event payload", JSON.stringify(payload, null, 2));
const { owner, repo } = context.repo;
await github.rest.repos.createDispatchEvent({
owner,
repo,
event_type: 'release',
client_payload: payload
});