Retry failed HTTP requests #424
This file contains hidden or 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: "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/setup-bazel@0.8.5 | |
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 | |
# keep a cache for MODULE.bazel repos | |
external-cache: true | |
- run: bazelisk build //... && bazelisk test //... | |
e2e-workspace-matrix: | |
strategy: | |
matrix: | |
version: | |
- version: 6.x | |
bazelrc: | | |
import %workspace%/../../.aspect/bazelrc/bazel6.bazelrc | |
- version: 7.x | |
bazelrc: | | |
import %workspace%/../../.aspect/bazelrc/bazel7.bazelrc | |
import %workspace%/../../.aspect/bazelrc/bazel6.bazelrc | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bazel-contrib/setup-bazel@0.8.5 | |
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 | |
${{ matrix.version.bazelrc }} | |
- run: cd e2e/bazel-workspace && USE_BAZEL_VERSION=${{ matrix.version.version }} bazelisk build //... | |
e2e-bzlmod-matrix: | |
strategy: | |
matrix: | |
version: [7.x, 8.x] | |
path: | |
- bazel-bzlmod | |
- bazel-bzlmod-lock-file | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bazel-contrib/setup-bazel@0.8.5 | |
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: cd e2e/${{ matrix.path }} && USE_BAZEL_VERSION=${{ matrix.version }} bazelisk build //... | |
e2e-bzlmod-build-toolchain-matrix: | |
strategy: | |
matrix: | |
version: [7.x, 8.x] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bazel-contrib/setup-bazel@0.8.5 | |
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: cd e2e/bazel-bzlmod-toolchain-from-source && USE_BAZEL_VERSION=${{ matrix.config.version }} bazelisk build //... ${{ matrix.config.flags }} | |
e2e-repo-yaml: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bazel-contrib/setup-bazel@0.8.5 | |
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=7.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 | |
e2e-bzlmod-lock-file-from-args: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bazel-contrib/setup-bazel@0.8.5 | |
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: | | |
cd e2e/bazel-bzlmod-lock-file-from-args && bazelisk run :bazeldnf -- fetch && bazelisk run @bazeldnf_rpms//:update-lock-file && bazelisk build ... | |
e2e-bzlmod-toolchain-circular-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bazel-contrib/setup-bazel@0.8.5 | |
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 | |
- id: prepare | |
run: | | |
cd e2e/bzlmod-toolchain-circular-dependencies | |
bazelisk run @bazeldnf_rpms//:fetch-repo | |
bazelisk run @bazeldnf_rpms//:update-lock-file | |
- id: test | |
run: | | |
cd e2e/bzlmod-toolchain-circular-dependencies | |
bazelisk build //... || status=$? | |
if [ ${status} -ne 0 ]; then | |
echo "::warning::Optional job failed." | |
echo "optional_fail=true" >> "${GITHUB_OUTPUT}" | |
echo "optional_fail_status=${status}" >> "${GITHUB_OUTPUT}" | |
fi |