Skip to content

Calls Vitest With NPX #7

Calls Vitest With NPX

Calls Vitest With NPX #7

Workflow file for this run

name: Code Checks
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
jobs:
setup:
name: Setup Environment
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.cache-check.outputs.cache-hit }}
steps:
- uses: actions/checkout@v4
with:
lfs: false
- name: Checkout LFS
run: git lfs pull
- uses: actions/setup-node@v4
with:
node-version-file: "project/.nvmrc"
cache: "npm"
cache-dependency-path: "project/package.json"
- name: Check Cache
id: cache-check
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('project/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install NPM Dependencies
if: steps.cache-check.outputs.cache-hit != 'true'
run: npm install
working-directory: ./project
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: project-files
path: ./project
retention-days: 1
compression-level: 4
overwrite: true
lint:
name: Linter
needs: setup
runs-on: ubuntu-latest
if: needs.setup.outputs.cache-hit == 'true' || always()
steps:
- uses: actions/download-artifact@v4
with:
name: project-files
path: ./project
- name: Run Linter
run: npm run lint
working-directory: ./project
test:
name: Tests
needs: setup
runs-on: ubuntu-latest
if: needs.setup.outputs.cache-hit == 'true' || always()
steps:
- uses: actions/download-artifact@v4
with:
name: project-files
path: ./project
- name: Run Tests
run: npm run test
working-directory: ./project
types:
name: TypeScript Type Check
needs: setup
runs-on: ubuntu-latest
if: needs.setup.outputs.cache-hit == 'true' || always()
steps:
- uses: actions/download-artifact@v4
with:
name: project-files
path: ./project
- name: Run Type Check
run: npm run lint:types
working-directory: ./project