Set up CI to run buck2 samples #1958
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
schedule: | |
- cron: '0 12 * * *' # daily at 12:00 UTC | |
# Cancel pending jobs on push. | |
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-concurrency-to-cancel-any-in-progress-job-or-run | |
concurrency: | |
group: ${{ github.workflow }}.${{ github.ref }} | |
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
# Recommended here: https://github.com/bazelbuild/bazelisk/issues/88#issuecomment-625178467 | |
env: | |
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OPAL_RPC_CREDENTIALS: ${{ secrets.OPAL_RPC_CREDENTIALS }} | |
jobs: | |
test-matrix: | |
runs-on: | |
- self-hosted | |
- "os=${{ matrix.os }}" | |
- "arch=${{ matrix.arch }}" | |
- "os_distribution=${{ matrix.os_distribution }}" | |
- "os_version=${{ matrix.os_version }}" | |
- "revision=${{ matrix.revision }}" | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos | |
arch: x64 | |
os_distribution: monterey | |
os_version: "12" | |
revision: d04e89854b3931f4aaced77aa3a2fcad5834b3a6 | |
remote_execution: 'false' | |
- os: macos | |
arch: x64 | |
os_distribution: monterey | |
os_version: "12" | |
revision: d04e89854b3931f4aaced77aa3a2fcad5834b3a6 | |
remote_execution: 'true' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up authentication | |
shell: bash | |
run: cp infra/bazelrc .bazelrc.user | |
- name: Generate python requirements lock | |
shell: bash | |
run: bazel run //python:requirements.update | |
- name: Build and test | |
env: | |
ARCH: ${{ matrix.arch }} | |
OS: ${{ matrix.os }} | |
REMOTE_EXECUTION: ${{ matrix.remote_execution }} | |
run: python3 infra/test-all.py | |
ci-runners-test-matrix: | |
runs-on: | |
- self-hosted | |
- "os=linux" | |
- "arch=x64" | |
- "remote_execution=${{ matrix.remote_execution }}" | |
- "engflow-container-image=docker://645088952840.dkr.ecr.eu-west-1.amazonaws.com/engflow-ci/debian11-dind-x64@sha256:604855f1ecd6edad3f45f513ed0112b9e8e32589871133767a1a51944b07f487" | |
- "engflow-pool=ci_sysbox_x64" | |
- "engflow-runtime=sysbox-runc" | |
- "engflow-runner-id=${{ github.repository_id }}_ci-runners-test-matrix_${{ github.run_id }}_${{ github.run_number }}_${{ github.run_attempt }}" | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- remote_execution: 'false' | |
- remote_execution: 'true' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up authentication | |
shell: bash | |
run: cp infra/bazelrc .bazelrc.user | |
- name: Generate python requirements lock | |
shell: bash | |
run: bazel run //python:requirements.update | |
- name: Build and test | |
env: | |
ARCH: x64 | |
OS: linux | |
REMOTE_EXECUTION: ${{ matrix.remote_execution }} | |
run: python3 infra/test-all.py | |
buck2-test: | |
runs-on: | |
- self-hosted | |
- "os=linux" | |
- "arch=x64" | |
- "engflow-container-image=docker://645088952840.dkr.ecr.eu-west-1.amazonaws.com/engflow-ci/debian11-dind-x64@sha256:604855f1ecd6edad3f45f513ed0112b9e8e32589871133767a1a51944b07f487" | |
- "engflow-pool=ci_sysbox_x64" | |
- "engflow-runtime=sysbox-runc" | |
- "engflow-runner-id=${{ github.repository_id }}_buck2-test_${{ github.run_id }}_${{ github.run_number }}_${{ github.run_attempt }}" | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Buck2 binary | |
shell: bash | |
run: infra/setup-buck2.sh | |
- name: Set up authentication | |
shell: bash | |
run: infra/auth-buck2.sh | |
- name: Build and test | |
shell: bash | |
run: infra/test-buck2.sh |