Skip to content

fix: don't panic when eval_origin is None #3208

fix: don't panic when eval_origin is None

fix: don't panic when eval_origin is None #3208

Workflow file for this run

# The core job execution is orchestrated by the `ci.yml` workflow.
name: CI
on:
# Run on any push to main or any tag
push:
branches:
- main
tags:
- '*'
# Run on any pull request
pull_request:
branches:
- main
jobs:
# This job computes the matrix for the subsequent jobs based on the repository and ref conditions. It reads
# the job configuration from embedded YAML and sets up the matrix for different OS and jobs.
#
# The extracted configurations are transformed into a matrix structure, which includes the label (job name),
# operating system (OS), and specific job type.
compute-jobs:
runs-on: ubuntu-latest
outputs:
# If we're not running in the denoland repo, use the 'nop' matrix that runs a single, no-op job
matrix: |
${{
steps.read-jobs-fast.outputs.matrix
|| steps.read-jobs-pr.outputs.matrix
|| steps.read-jobs-tag.outputs.matrix
|| '{ "label": "linux", "os": "ubuntu-latest", "job": "nop" }'
}}
is_tag: ${{ github.repository == 'denoland/deno_core' && startsWith(github.ref, 'refs/tags/') }}
is_main: ${{ github.repository == 'denoland/deno_core' && github.ref == 'refs/heads/main' }}
steps:
# https://github.com/marketplace/actions/query-yaml-config-as-outputs
# Extract the jobs, then combine them with the os/uses line to build an array of 'includes' lines for the
# matrix below
# Test this using jq/yq: cat config.yaml | yq -o json | jq
- name: Read job configuration (PR/main fast-build)
uses: cloudposse/github-action-yaml-config-query@main
id: read-jobs-fast
if: github.repository == 'denoland/deno_core' && contains(github.event.pull_request.labels.*.name, 'fast-build') && (!startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')
with:
query: "{ matrix: [. | to_entries[] | . as $entry | .value.jobs[] | { label: $entry.key, os: $entry.value.os, job: . }] }"
config: |-
linux:
os: ubuntu-latest
jobs: [lint, test]
- name: Read job configuration (PR/main)
uses: cloudposse/github-action-yaml-config-query@main
id: read-jobs-pr
if: github.repository == 'denoland/deno_core' && (!startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main')
with:
query: "{ matrix: [. | to_entries[] | . as $entry | .value.jobs[] | { label: $entry.key, os: $entry.value.os, job: . }] }"
config: |-
linux:
os: ubuntu-latest
jobs: [coverage, lint, lint-deps, test, test-miri, test-ops, test-publish]
linux-xl:
os: ubuntu-22.04-xl
jobs: [test-valgrind]
linux-arm:
os: ubuntu-22.04-arm64
jobs: [lint, test, test-miri]
macos:
os: macOS-latest
jobs: [lint, test]
windows:
os: windows-2019
jobs: [lint, test]
- name: Read job configuration (tag)
uses: cloudposse/github-action-yaml-config-query@main
id: read-jobs-tag
if: github.repository == 'denoland/deno_core' && startsWith(github.ref, 'refs/tags/')
with:
query: "{ matrix: [. | to_entries[] | . as $entry | .value.jobs[] | { label: $entry.key, os: $entry.value.os, job: . }] }"
config: |-
linux:
os: ubuntu-latest
jobs: [publish]
# This job is responsible for coordinating the execution of individual jobs defined in `ci-job.yml` based on the matrix generated
# by `compute-jobs`. It acts as the orchestrator for the overall CI workflow.
top:
name: build-${{ matrix.label }}
needs: compute-jobs
uses: ./.github/workflows/ci-job.yml
secrets: inherit
with:
label: ${{ matrix.label }}
os: ${{ matrix.os }}
job: ${{ matrix.job }}
is_main: ${{ needs.compute-jobs.outputs.is_main == 'true' }}
is_tag: ${{ needs.compute-jobs.outputs.is_tag == 'true' }}
strategy:
matrix:
include: ${{ fromJSON(needs.compute-jobs.outputs.matrix) }}
# A simple job that runs after the `top` job is successful. It prints a success message indicating that the CI workflow has
# completed successfully. This allows us to have a single "build success" step for the repository.
success:
needs: [top, compute-jobs]
runs-on: ubuntu-latest
if: ${{ always() }}
steps:
- name: Print variables
run: |
echo is_main: ${{ needs.compute-jobs.outputs.is_main == 'true' }}
echo is_tag: ${{ needs.compute-jobs.outputs.is_tag == 'true' }}
- name: Print failure
if: ${{ needs.top.result != 'success' }}
run: echo Failure ❌ && exit 1
- name: Print success
run: echo Success ✅