Skip to content

Commit

Permalink
chore: update node.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Feb 1, 2024
1 parent 4d80eb4 commit 259c4be
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,43 @@
name: Node

on:
pull_request:
push:
branches:
- main
on: pull_request

permissions:
contents: read

concurrency:
concurrency:
group: node-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [14, 16, 18]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

name: build
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up node ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
id: versions
with:
node-version: ${{ matrix.node-version }}
fallbackNode: '^20'
fallbackNpm: '^10'

- name: Install dependencies
run: npm ci
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Build
run: npm run build
- name: Install dependencies & build
run: |
npm ci
npm run build --if-present
- name: Check build changes
# See https://github.com/skjnldsv/check-actor-permission/blob/main/action.yml#L27
if: matrix.node-version == 16
run: |
bash -c "[[ ! \"`git status --porcelain `\" ]] || (echo 'Please recompile and commit the assets, see the section \"Show changes on failure\" for details' && exit 1)"
Expand Down

0 comments on commit 259c4be

Please sign in to comment.