From 2316c2a189ada6957a500cc7b103bc5b836f5094 Mon Sep 17 00:00:00 2001 From: sideshowbarker Date: Sun, 18 Feb 2024 14:26:40 +0900 Subject: [PATCH] Re-use the same runner among all jobs in ci-spec.yml workflow --- .github/workflows/ci-spec.yml | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-spec.yml b/.github/workflows/ci-spec.yml index a806b24394..791b165beb 100644 --- a/.github/workflows/ci-spec.yml +++ b/.github/workflows/ci-spec.yml @@ -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 @@ -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 @@ -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" @@ -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" @@ -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 @@ -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