Skip to content

Bump actions/setup-node from 4.1.0 to 4.2.0 #929

Bump actions/setup-node from 4.1.0 to 4.2.0

Bump actions/setup-node from 4.1.0 to 4.2.0 #929

name: JavaScript 🟨🟦🟩🟥 Tests 🦂
on:
push:
branches-ignore:
- 'main'
paths:
- 'javascript/**'
- '!javascript/**.md'
- '!javascript/.vscode/**'
- '.github/workflows/javascript-*'
pull_request:
branches:
- 'main'
paths:
- 'javascript/**'
- '!javascript/**.md'
- '!javascript/.vscode/**'
- '.github/workflows/javascript-*'
schedule: # 9AM on the 15th
- cron: 0 22 14 1,2,3,10,11,12 * # AEDT Months
- cron: 0 23 14 4,5,6,7,8,9 * # AEST Months
workflow_call:
permissions: {}
defaults:
run:
shell: bash
working-directory: javascript
jobs:
quick-test:
name: JavaScript 🟨🟦🟩🟥 Quick Test 🦂
if: ${{ github.event_name == 'push' && !(github.event.ref == 'refs/heads/main') }}
runs-on: ubuntu-latest
steps:
- name: 🏁 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🟨🟦🟩🟥 Set up Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version-file: 'javascript/.nvmrc'
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
- name: 🧱 Install build dependencies
run: make setup
- name: 🦂 Test
run: make test
- name: 🧹 Lint
run: make lint
- name: ⚖ Does the checked in JS match the transpiled TS?
run: make verify_transpiled_checkin
- name: ⭐ JSR dry-run
run: npm run publish:jsr:dry
full-test:
name: JavaScript 🟨🟦🟩🟥 Full Test 🦂
if: >-
${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.event.ref == 'refs/heads/main') }}
runs-on: '${{ matrix.os }}'
strategy:
fail-fast: false
matrix:
version: ['18', '20', '21'] # See package.json's "engines"
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- name: 🏁 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🟨🟦🟩🟥 Set up Node ${{ matrix.version }}
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: '${{ matrix.version }}'
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
# Strip the nvm wrapping for the "full test" (it's still required by the necessary "quick test")
- name: 🧱 Install build dependencies
run: make setup NPM='npm' INSTALL_NODE=''
- name: 🦂 Test
run: make test NPM='npm'
- name: 🧹 Lint
run: make lint _=''
# We probably don't need to do this on all runners, and the windows CRLF echos are annoying
# - name: ⚖ Does the checked in JS match the transpiled TS?
# run: make verify_transpiled_checkin
built-example:
name: JavaScript 🟨🟦🟩🟥 Build Example 🦛
if: >-
${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.event.ref == 'refs/heads/main') }}
runs-on: ubuntu-latest
steps:
- name: 🏁 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🟨🟦🟩🟥 Set up Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version-file: 'javascript/.nvmrc'
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
- name: 🧱 Install build dependencies
run: make setup
- name: 🧱 Build
run: make build
- name: 🆙 Upload dists
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: Package
path: javascript/skenvy-collatz-*.tgz
if-no-files-found: error
retention-days: 1
usage-demonstration:
name: JavaScript 🟨🟦🟩🟥 Usage Demonstration 🦏
needs: [built-example]
if: >-
${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.event.ref == 'refs/heads/main') }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: javascript/.demo
steps:
- name: 🏁 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🟨🟦🟩🟥 Set up Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version-file: 'javascript/.nvmrc'
- name: 🆒 Download dists
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: Package
path: javascript/.demo
- name: 🦛 Install this package
run: npm run setup
- name: 🦏 Transpile and run demonstration; 🦑 CJS
run: npm run everything:cjs
- name: 🦏 Transpile and run demonstration; 🐙 ESM
run: npm run everything:esm
codeql:
name: JavaScript 🟨🟦🟩🟥 CodeQL 🛡👨‍💻🛡
if: >-
${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.event.ref == 'refs/heads/main') }}
permissions:
actions: read
contents: read
security-events: write
uses: ./.github/workflows/github-codeql.yaml
with:
language: 'javascript'
docs:
name: JavaScript 🟨🟦🟩🟥 Docs 📄 Quick Test 🦂
runs-on: ubuntu-latest
steps:
- name: 🏁 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🟨🟦🟩🟥 Set up Node
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version-file: 'javascript/.nvmrc'
cache: 'npm'
cache-dependency-path: javascript/package-lock.json
- name: 🧱 Install build dependencies
run: make setup
- name: 📄 Docs
run: make docs