Skip to content

Commit

Permalink
Move dist/index.js check to a separate job
Browse files Browse the repository at this point in the history
Run the check that dist/index.js is up to date only once, not for each
compiler and platform.

Signed-off-by: Andrei Horodniceanu <[email protected]>
  • Loading branch information
the-horo authored and WebFreak001 committed May 30, 2024
1 parent bd956fc commit 56a46e8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
16 changes: 0 additions & 16 deletions .github/actions/verify-d-compiler/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

0 comments on commit 56a46e8

Please sign in to comment.