Merge branch 'main' into feature/update-jco #505
Workflow file for this run
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: | |
# Run using manual triggers from GitHub UI: | |
# https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow | |
workflow_dispatch: {} | |
# Run on every pull request: | |
pull_request: {} | |
# Run on pushes to any branch even 'main', as it is used to refresh the CI cache from scratch, so that it doesn't grow indefinitely: | |
push: {} | |
# In the event that there is a new push to the ref, cancel any running jobs because they are now obsolete, wasting resources. | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref_name }}" | |
cancel-in-progress: true | |
jobs: | |
ci: | |
runs-on: "ubuntu-22.04" # _SLANG_DEV_CONTAINER_BASE_IMAGE_ (keep in sync) | |
# Skip 'pull_request' events from the main repository, as the workflow is already triggered by the 'push' event: | |
if: "${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != 'NomicFoundation/slang' }}" | |
steps: | |
- name: "Checkout Repository" | |
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" | |
# Cache is updated in this workflow, and reused in subsequent workflows. | |
# Always start with a fresh cache when running on the main branch. | |
- name: "Restore Cache" | |
if: "${{ github.ref_name != 'main' }}" | |
uses: "./.github/actions/cache/restore" | |
# | |
# Run all CI steps in order: _SLANG_INFRA_CI_STEPS_ORDERED_ (keep in sync) | |
# | |
- name: "infra setup" | |
run: "./scripts/bin/infra setup" | |
- name: "infra check" | |
run: "./scripts/bin/infra check" | |
- name: "infra test" | |
run: "./scripts/bin/infra test" | |
- name: "infra lint" | |
run: "./scripts/bin/infra lint" | |
- name: "Save Cache" | |
uses: "./.github/actions/cache/save" | |
# We cannot run the full CI in devcontainers, as we will run out of disk space in GitHub Actions. | |
# Instead, we just validate the devcontainer is built correctly by running a minimal check below. | |
validate-devcontainer: | |
runs-on: "ubuntu-22.04" # _SLANG_DEV_CONTAINER_BASE_IMAGE_ (keep in sync) | |
# Skip 'pull_request' events from the main repository, as the workflow is already triggered by the 'push' event: | |
if: "${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != 'NomicFoundation/slang' }}" | |
steps: | |
- name: "Checkout Repository" | |
uses: "actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683" | |
# NOTE: | |
# No need to run 'infra setup', as it runs automatically when the devcontainer is launched. | |
- name: "infra lint mkdocs" | |
uses: "./.github/actions/devcontainer/run" | |
with: | |
runCmd: "./scripts/bin/infra lint mkdocs" |