forked from qld-gov-au/qgds-bootstrap5
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up cicd, no point running two containers when one can do all fa…
…ster
- Loading branch information
Showing
2 changed files
with
3,760 additions
and
1,745 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,77 +12,12 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
validate: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [ '20'] | ||
name: Lint test on Node ${{ matrix.node }} | ||
steps: | ||
- run: echo ${{github.ref}} | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'npm' | ||
#always-auth: 'true' | ||
#registry-url: 'https://nexus.tools.services.qld.gov.au/nexus/repository/npm_all/' | ||
|
||
- name: Cache node modules | ||
id: cache-npm | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | ||
name: List the state of node modules | ||
continue-on-error: true | ||
run: npm list | ||
|
||
- name: npmrc #run on lint step (Which is cached) | ||
run: | | ||
npm -v | ||
node -v | ||
# cat /home/runner/work/_temp/.npmrc #only nice to test when registry is altered | ||
#env: | ||
# NODE_AUTH_TOKEN: ${{ secrets.NEXUSREADONLY2NPMTOKEN }} | ||
|
||
- name: Install | ||
run: | # Install packages | ||
npm install --prefer-offline --no-audit --ignore-scripts --force | ||
#env: | ||
# NODE_AUTH_TOKEN: ${{ secrets.NEXUSREADONLY2NPMTOKEN }} | ||
|
||
# `npm rebuild` will run all those post-install scripts for us. | ||
- name: rebuild and prepare | ||
run: npm rebuild && npm run prepare --if-present | ||
|
||
- name: Lint | ||
run: | | ||
npm run lint | ||
- name: Test | ||
run: | | ||
npm run test | ||
build: | ||
needs: validate | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [ '20' ] | ||
name: Build and Deploy on Node ${{ matrix.node }} | ||
name: Lint, Test, Build and Deploy on Node ${{ matrix.node }} | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
|
@@ -123,6 +58,14 @@ jobs: | |
- name: rebuild and prepare | ||
run: npm rebuild && npm run prepare --if-present | ||
|
||
- name: Lint | ||
run: | | ||
npm run lint | ||
- name: Test | ||
run: | | ||
npm run test | ||
- name: Build 🔧 | ||
run: | # build the files | ||
npm run build | ||
|
Oops, something went wrong.