Skip to content

Fix tests

Fix tests #2852

Workflow file for this run

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:
macos-test-matrix:
runs-on:
- self-hosted
- "os=macos"
- "arch=arm64"
- "os_distribution=sonoma"
- "os_version=14"
- "revision=4edc10aa8f8ca239699aaf1078832208fb3b7efe"
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
test_package:
- cpp
- csharp
- docker
- genrules
- go
- ios
- java
- kotlin
- perl
- scala
- swift
- typescript
remote_execution: [true, false]
steps:
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd"
- 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: arm64
OS: macos
REMOTE_EXECUTION: ${{ matrix.remote_execution }}
run: python3 infra/test-all.py --package=${{ matrix.test_package }}
linux-test-matrix:
runs-on:
- self-hosted
- "os=linux"
- "arch=x64"
- "remote_execution=${{ matrix.remote_execution }}"
- "engflow-bento-name=example-gh-x64"
- "engflow-cluster=glass"
- "engflow-job-name=ci-runners-test-matrix-${{matrix.remote_execution}}_${{matrix.allow_bento_snapshot}}"
- "engflow-job-type=${{github.event_name}}-${{github.ref_name}}"
- "engflow-run-id=${{ github.run_id }}"
# To avoid a race condition, among all the jobs that use the same Bento in the same repo, only
# one should specify "engflow-bento-allow-save=true".
#- "engflow-bento-allow-save=${{ matrix.allow_bento_snapshot }}"
# TODO: restore the above line before submit but after ensuring it is set properly
- "engflow-bento-allow-save=false"
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
test_package:
- cpp
- csharp
- docker
- genrules
- go
- ios
- java
- kotlin
- perl
- scala
- swift
- typescript
remote_execution: [true, false]
allow_bento_snapshot: [false]
include:
- test_package: 'cpp'
remote_execution: 'true'
# Only one job from the matrix should set allow_bento_snapshot.
allow_bento_snapshot: 'true'
steps:
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd"
- 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 --package=${{ matrix.test_package }}
buck2-test:
runs-on:
- self-hosted
- "os=linux"
- "arch=x64"
- "engflow-bento-name=example-gh-buck2-x64"
- "engflow-cluster=glass"
- "engflow-job-name=ci-runners-test-matrix"
- "engflow-job-type=${{github.event_name}}-${{github.ref_name}}"
- "engflow-run-id=${{ github.run_id }}"
timeout-minutes: 10
steps:
- uses: "actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd"
- 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