Skip to content

schema_version

schema_version #21

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches: [devel, cloud]
tags: [v**]
pull_request:
branches: [main, cloud, devel]
env:
GITHUB_REGISTRY: ghcr.io
DEV_CONTAINER_DOCKER_IMAGE: bencher-dev-container
# Cancel in-progress runs for the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Determine what changed
changes:
name: Detect Changes
runs-on: ubuntu-22.04
outputs:
rust: ${{ steps.filter.outputs.rust }}
console: ${{ steps.filter.outputs.console }}
action: ${{ steps.filter.outputs.action }}
api: ${{ steps.filter.outputs.api }}
cli: ${{ steps.filter.outputs.cli }}
docker: ${{ steps.filter.outputs.docker }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
rust:
- 'Cargo.toml'
- 'Cargo.lock'
- 'lib/**'
- 'plus/**'
- 'services/api/**'
- 'services/cli/**'
- 'tasks/**'
- 'xtask/**'
console:
- 'services/console/**'
- 'lib/bencher_valid/**'
action:
- 'services/action/**'
- 'services/api/openapi.json'
api:
- 'services/api/**'
- 'lib/**'
- 'plus/**'
cli:
- 'services/cli/**'
- 'lib/**'
docker:
- 'services/api/Dockerfile'
- 'services/console/Dockerfile'
- 'docker/**'
lint:
name: Lint
uses: ./.github/workflows/lint.yml
with:
mold-version: "2.34.1"
typeshare-version: "1.13.2"
cli:
name: CLI
needs: changes
uses: ./.github/workflows/cli.yml
with:
bencher-version: "0.5.10"
mold-version: "2.34.1"
zig-build-version: "0.19.3"
zig-version: "0.13.0"
# Use minimum supported glibc version for Rust Tier 1
# https://doc.rust-lang.org/nightly/rustc/platform-support.html#tier-1-with-host-tools
glibc-version: "2.17"
check-cli: ${{ needs.changes.outputs.cli == 'true' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/cloud' }}
build-cli: ${{ needs.changes.outputs.cli == 'true' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/cloud' || startsWith(github.ref, 'refs/tags/') }}
secrets:
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
test:
name: Test
needs: changes
if: ${{ needs.changes.outputs.rust == 'true' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/cloud' || startsWith(github.ref, 'refs/tags/') }}
uses: ./.github/workflows/test.yml
with:
mold-version: "2.34.1"
is-fork: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
secrets:
TEST_BILLING_KEY: ${{ secrets.TEST_BILLING_KEY }}
BENCHER_API_TOKEN: ${{ secrets.BENCHER_API_TOKEN }}
build:
name: Build
needs: changes
uses: ./.github/workflows/build.yml
with:
mold-version: "2.34.1"
wasm-pack-version: "0.12.1"
litestream-version: "0.3.13"
build-action: ${{ needs.changes.outputs.action == 'true' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/cloud' || startsWith(github.ref, 'refs/tags/') }}
build-docker: ${{ needs.changes.outputs.docker == 'true' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/cloud' || startsWith(github.ref, 'refs/tags/') }}
deploy:
name: Deploy
needs: [lint, cli, test, build]
if: ${{ github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/cloud' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy')) }}
uses: ./.github/workflows/deploy.yml
with:
mold-version: "2.34.1"
netlify-cli-version: "18.0.4"
deploy-dev: ${{ github.ref == 'refs/heads/devel' || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy')) }}
deploy-test: ${{ github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/cloud' }}
deploy-prod: ${{ github.ref == 'refs/heads/cloud' }}
secrets:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
release:
name: Release
if: ${{ needs.changes.outputs.rust == 'true' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/cloud' || startsWith(github.ref, 'refs/tags/') }}
needs: [changes, lint, cli, test, build]
uses: ./.github/workflows/release.yml
with:
mold-version: "2.34.1"
ci-success:
name: CI Success
if: always()
needs: [lint, cli, test, build, deploy, release]
runs-on: ubuntu-22.04
steps:
- name: Check all jobs passed
run: |
if [[ "${{ needs.lint.result }}" != "success" ]]; then
echo "Lint failed"
exit 1
fi
if [[ "${{ needs.cli.result }}" != "success" ]]; then
echo "CLI failed"
exit 1
fi
if [[ "${{ needs.test.result }}" != "success" && "${{ needs.test.result }}" != "skipped" ]]; then
echo "Test failed"
exit 1
fi
if [[ "${{ needs.build.result }}" != "success" ]]; then
echo "Build failed"
exit 1
fi
if [[ "${{ needs.deploy.result }}" != "success" && "${{ needs.deploy.result }}" != "skipped" ]]; then
echo "Deploy failed"
exit 1
fi
echo "All required jobs passed!"
build_dev_container:
name: Build dev container
if: ${{ github.ref == 'refs/heads/devel' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.GITHUB_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pre-build dev container image
uses: devcontainers/ci@v0.3
with:
imageName: ${{ env.GITHUB_REGISTRY }}/${{ github.repository_owner }}/${{ env.DEV_CONTAINER_DOCKER_IMAGE }}
cacheFrom: ${{ env.GITHUB_REGISTRY }}/${{ github.repository_owner }}/${{ env.DEV_CONTAINER_DOCKER_IMAGE }}
push: always