Skip to content

ci(action): update actions/cache action to v5.0.3 (#657) #6177

ci(action): update actions/cache action to v5.0.3 (#657)

ci(action): update actions/cache action to v5.0.3 (#657) #6177

Workflow file for this run

name: CI
permissions:
contents: read
on:
pull_request:
push:
branches:
- main
jobs:
build:
name: πŸ‘· Build
runs-on: ubuntu-latest
strategy:
matrix:
version: [16, 18, 20, 22, 24]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ matrix.version }}
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.
- name: Install dependencies
run: npm ci --ignore-scripts
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }}
- name: Building
run: npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }}
- name: Examples - es6
run: cd examples/es6 && npm i && npm run build
- name: Examples - common
run: cd examples/commonjs && npm i
- name: Examples - Management CLI
run: cd examples/managementCli && npm i && npm run build
eslint:
name: πŸͺ₯ ESLint
runs-on: ubuntu-latest
strategy:
matrix:
version: [16, 18, 20, 22, 24]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ matrix.version }}
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.
- name: Install dependencies
run: npm ci --ignore-scripts
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }}
- run: npm run format-check
- run: npm run lint
gitleaks:
name: πŸ”’ Run Git leaks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version-file: package.json
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.
- name: Install dependencies
run: npm ci --ignore-scripts
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }}
- name: Gitleaks
run: npm run leaks
shell: bash
pr-title-check:
name: βœ… Validate PR Title
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Validate PR title follows Semantic Commit Convention
uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
docs
style
refactor
perf
test
build
ci
chore
revert
requireScope: false
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
unit-test:
name: πŸ‘” Run Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
version: [16, 18, 20, 22, 24]
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: ${{ matrix.version }}
# Skip post-install scripts here, as a malicious
# script could steal NODE_AUTH_TOKEN.
- name: Install dependencies and build
run: npm ci --ignore-scripts && npm run build
env:
CI: true
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }}
- name: Testing
run: npm test
ready:
name: πŸš€ Ready
runs-on: ubuntu-latest
needs: [build, eslint, gitleaks, pr-title-check, unit-test]
steps:
- name: Ready
run: echo "All checks passed and the PR is ready to be merged!"