Skip to content

Commit

Permalink
Use the "prepare" script only when necessary
Browse files Browse the repository at this point in the history
Since package.json contains a "prepare" life cycle script which invokes
the build, all invocations of `npm ci` and some other scripts will also
build Auspice, even if the build is not used in some CI jobs.

Use --ignore-scripts to skip all life cycle scripts and explicitly call
npm run build when the build is necessary. This should improve build
times, especially for the "build" job which was effectively running the
build twice.

Note that `npm ci --ignore-scripts && npm run build` is NOT the same as
`npm ci` alone, since --ignore-scripts also ignores life cycle scripts
defined by dependencies. This is why `npm ci` is still necessary for
smoke-test even though it doesn't explicitly require the Auspice build.
  • Loading branch information
victorlin committed Mar 20, 2023
1 parent c4e7acd commit e29c01c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
with:
node-version: ${{ matrix.node }}
- run: node --version
# Build is implicit with the "prepare" life cycle script
- run: npm ci
- run: npm run build

unit-test:
runs-on: ubuntu-latest
Expand All @@ -33,7 +33,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
- run: node --version
- run: npm ci
- run: npm ci --ignore-scripts
- run: npm test

smoke-test:
Expand All @@ -60,7 +60,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm ci --ignore-scripts
- run: npm run lint

bundlesize:
Expand Down

0 comments on commit e29c01c

Please sign in to comment.