CI #244
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: [push, pull_request] | |
jobs: | |
success: | |
needs: top | |
runs-on: ubuntu-latest | |
steps: | |
- name: Print success | |
run: echo Success ✅ | |
compute-jobs: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.read-jobs.outputs.matrix }} | |
steps: | |
# https://github.com/marketplace/actions/query-yaml-config-as-outputs | |
- name: Read job configuration | |
uses: cloudposse/github-action-yaml-config-query@main | |
id: read-jobs | |
with: | |
# 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 | |
query: "{ matrix: [. | to_entries[] | . as $entry | .value.jobs[] | { label: $entry.key, os: $entry.value.os, job: . }] }" | |
config: |- | |
linux: | |
os: ubuntu-latest | |
jobs: [lint, lint-deps, test, test-miri, test-ops] | |
macos: | |
os: macOS-latest | |
jobs: [lint, test] | |
windows: | |
os: windows-2019 | |
jobs: [lint, test] | |
top: | |
name: build-${{ matrix.label }} | |
needs: compute-jobs | |
if: github.repository == 'denoland/deno_core' | |
uses: ./.github/workflows/ci-job.yml | |
with: | |
label: ${{ matrix.label }} | |
os: ${{ matrix.os }} | |
job: ${{ matrix.job }} | |
strategy: | |
matrix: | |
include: ${{ fromJSON(needs.compute-jobs.outputs.matrix) }} | |
publish: | |
name: publish | |
needs: top | |
if: (github.repository == 'denoland/deno_core' && startsWith(github.ref, 'refs/tags/')) || contains(github.event.pull_request.labels.*.name, 'cargo-publish-dry-run') | |
uses: ./.github/workflows/ci-job.yml | |
secrets: inherit | |
with: | |
label: linux | |
os: ubuntu-latest | |
job: publish |