Skip to content

Mnaranjo/revamp e2e #638

Mnaranjo/revamp e2e

Mnaranjo/revamp e2e #638

Workflow file for this run

name: "build and test"
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
# Cancel previous actions from the same PR or branch except 'main' branch.
# See https://docs.github.com/en/actions/using-jobs/using-concurrency and https://docs.github.com/en/actions/learn-github-actions/contexts for more info.
group: concurrency-group::${{ github.workflow }}::${{ github.event.pull_request.number > 0 && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}${{ github.ref_name == 'main' && format('::{0}', github.run_id) || ''}}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Keep a disk-cache
disk-cache: true
# Share repository cache between workflows.
repository-cache: true
# enable some flags for CI
bazelrc: |
try-import %workspace%/.aspect/bazelrc/ci.bazelrc
try-import %workspace%/.github/workflows/ci.bazelrc
try-import %workspace%/../../.aspect/bazelrc/ci.bazelrc
try-import %workspace%/../../.github/workflows/ci.bazelrc
# keep a cache for MODULE.bazel repos
external-cache: true
- id: build
run: bazelisk build //...
- id: unit-tests
run: bazelisk test //...
- id: e2e-that-should-pass
run: bazelisk test e2e --jobs 1 --nokeep_going
- id: e2e-that-are-allowed-to-fail
continue-on-error: true
run: bazel test //e2e:circular-deps --jobs 1 --nokeep_going
e2e-repo-yaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bazel-contrib/[email protected]
with:
# Avoid downloading Bazel every time.
bazelisk-cache: true
# Keep a disk-cache
disk-cache: true
# Share repository cache between workflows.
repository-cache: true
# enable some flags for CI
bazelrc: |
import %workspace%/.aspect/bazelrc/ci.bazelrc
import %workspace%/.github/workflows/ci.bazelrc
- run: |
export USE_BAZEL_VERSION=8.x
bazelisk run //cmd -- init --fc 41 --output $(pwd)/repo.yaml
bazelisk run //cmd -- fetch --repofile $(pwd)/repo.yaml
bazelisk run //cmd -- resolve --repofile $(pwd)/repo.yaml bash