Skip to content

fix: Setup yarn correctly for linting-action file #89

fix: Setup yarn correctly for linting-action file

fix: Setup yarn correctly for linting-action file #89

Workflow file for this run

# Job name
name: Integration and Unit Tests
# When the to run the greeting
on: [pull_request, push]
# Jobs to run for the action (You can have multiple actions in one file)
jobs:
test:
# Job display name
name: Running Vitest tests
# Runs on a Linux based OS
runs-on: ubuntu-latest
# Run the job on Node 18 and 20 which better support modern testing frameworks
strategy:
matrix:
node-version: [18.x, 20.x]
# Steps involved for this particular task
steps:
# Checks out the repository and enables the use of commands made available in the project ie npm run
- name: Check out Git repository
uses: actions/checkout@v2
# Setup Nodes on the versions specified in the matrix stratergy
- name: Set up Node.js version ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# Enable Corepack for Yarn
- name: Enable Corepack
run: corepack enable
# Set Yarn version
- name: Set Yarn version
run: yarn set version 4.2.2
# Cache the yarn dependencies
- name: Cache yarn dependencies
uses: actions/cache@v2
env:
cache-name: cache-yarn-dependencies
with:
path: |
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Install dependencies using Yarn
- name: Install dependencies
run: yarn install
# Run the Vitest tests
- name: Run all tests
env:
OPEN_MOVIE_DB_API_URI: ${{ secrets.OPEN_MOVIE_DB_API_URI }}
OPEN_MOVIE_DB_API_KEY: ${{ secrets.OPEN_MOVIE_DB_API_KEY }}
run: yarn test