diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 0000000..65b82c0 --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,3 @@ +# GitHub Workflows + +Use `act` for testing workflows locally: https://nektosact.com/introduction.html diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..8979d57 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + pull_request: + branches: [main] + workflow_dispatch: + +concurrency: + # Cancel previous actions from the same PR: https://stackoverflow.com/a/72408109 + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + format: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Bazel + uses: bazel-contrib/setup-bazel@0.8.0 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true + bazelrc: | + build --color=yes + build --show_timestamps + - name: Format Repository + run: bazel run //:format