Skip to content

Commit

Permalink
Re-use the same runner among all jobs in ci-spec.yml workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sideshowbarker committed Feb 18, 2024
1 parent ddb1751 commit 2316c2a
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/ci-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,24 @@ on:
workflow_dispatch:

jobs:
establish-job-runner:
name: Get a containerized runner name to use for this workflow
runs-on: [self-hosted, ubuntu-latest]
outputs:
established-runner: ${{ runner.name }}
steps:
- run: echo "selected runner = ${{ runner.name }}"

set-up-bikeshed:
runs-on: ubuntu-latest
needs: [establish-job-runner]
runs-on: ${{ needs.establish-job-runner.outputs.established-runner }}
steps:
- name: Setup Bikeshed
run: pip install bikeshed && bikeshed update

set-up-environment:
runs-on: ubuntu-latest
needs: [set-up-bikeshed]
needs: [establish-job-runner, set-up-bikeshed]
runs-on: ${{ needs.establish-job-runner.outputs.established-runner }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand All @@ -38,7 +47,7 @@ jobs:

build-core-spec:
runs-on: ubuntu-latest
needs: [set-up-environment]
needs: [establish-job-runner, set-up-environment]
steps:
- name: Build main spec
run: cd document/core && make main
Expand All @@ -52,7 +61,7 @@ jobs:

build-js-api-spec:
runs-on: ubuntu-latest
needs: [set-up-bikeshed]
needs: [establish-job-runner, set-up-bikeshed]
steps:
- name: Run Bikeshed
run: bikeshed spec "document/js-api/index.bs" "document/js-api/index.html"
Expand All @@ -64,7 +73,7 @@ jobs:

build-web-api-spec:
runs-on: ubuntu-latest
needs: [set-up-bikeshed]
needs: [establish-job-runner, set-up-bikeshed]
steps:
- name: Run Bikeshed
run: bikeshed spec "document/web-api/index.bs" "document/web-api/index.html"
Expand All @@ -76,7 +85,7 @@ jobs:

publish-spec:
runs-on: ubuntu-latest
needs: [build-core-spec, build-js-api-spec, build-web-api-spec]
needs: [establish-job-runner, build-core-spec, build-js-api-spec, build-web-api-spec]
steps:
- name: Create output directory
run: mkdir _output && cp document/index.html _output/index.html
Expand Down Expand Up @@ -104,7 +113,7 @@ jobs:

publish-to-w3c-TR:
runs-on: ubuntu-latest
needs: [set-up-environment]
needs: [establish-job-runner, set-up-environment]
steps:
- name: Publish all specs to their https://www.w3.org/TR/ URLs
run: cd document && make -e WD-echidna-CI
Expand Down

0 comments on commit 2316c2a

Please sign in to comment.