chore(deps): bump actions/checkout from 3 to 4 #256
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
name: Unit testing | |
on: | |
pull_request: | |
branches: | |
- master | |
- 'releases/*' | |
jobs: | |
cancel-previous-runs: | |
name: Cancel previous runs | |
runs-on: ubuntu-latest | |
steps: | |
- name: ⏹ Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
unit-tests: | |
name: Run unit tests in the project | |
runs-on: ubuntu-latest | |
steps: | |
- name: 💻 Checkout | |
uses: actions/checkout@v4 | |
- name: 🔨 Read .nvmrc | |
id: read_nvmrc | |
run: | | |
echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT | |
- name: 🔨 Setup node | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ steps.read_nvmrc.outputs.NODE_VERSION }} | |
- name: 🔨 Get npm cache directory | |
id: npm-cache | |
run: | | |
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | |
- name: 🔨 Cache dependencies | |
uses: actions/[email protected] | |
with: | |
path: ${{ steps.npm-cache.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: 🚧 Install dependencies | |
run: npm ci | |
- name: 🔄 Run tests | |
run: npm test |