From 56a46e8b3f25e53ed75c8c31ab2354c4ced5b529 Mon Sep 17 00:00:00 2001 From: Andrei Horodniceanu Date: Mon, 6 May 2024 13:14:36 +0300 Subject: [PATCH] Move dist/index.js check to a separate job Run the check that dist/index.js is up to date only once, not for each compiler and platform. Signed-off-by: Andrei Horodniceanu --- .github/actions/verify-d-compiler/action.yml | 16 ---------------- .github/workflows/test.yml | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/actions/verify-d-compiler/action.yml b/.github/actions/verify-d-compiler/action.yml index 67389b4..3579a9f 100644 --- a/.github/actions/verify-d-compiler/action.yml +++ b/.github/actions/verify-d-compiler/action.yml @@ -36,19 +36,3 @@ runs: if: ${{ !startsWith(inputs.dc, 'g') }} # dub doesn't come with gdc by default shell: bash run: dub run --single -q .github/hello.d - - - name: Install Node.js 20.x - uses: actions/setup-node@v4 - with: - node-version: 20 - - - name: Ensure `dist/index.js` is up to date - env: - NODE_OPTIONS: "--openssl-legacy-provider" - run: | - set -euxo pipefail - npm ci - npm run build - # exclude dist/index.js.map (different on Windows) - git diff --stat --exit-code HEAD -- ':!dist/index.js.map' - shell: bash diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 45d2e7e..ce2a506 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -145,3 +145,21 @@ jobs: - name : Compile with dub run: | cd .github && dub run --single hello.d --compiler=${DC} + + verify-index-js-up-to-date: + name: Verify that `dist/index.js` is up to date + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - name: diff-ing dist/index.js + env: + NODE_OPTIONS: "--openssl-legacy-provider" + run: | + set -euxo pipefail + npm ci + npm run build + # exclude dist/index.js.map (different on Windows) + git diff --stat --exit-code HEAD -- ':!dist/index.js.map'