Skip to content

Pull Request Checks #17

Pull Request Checks

Pull Request Checks #17

Workflow file for this run

name: Pull Request Checks
on:
pull_request:
workflow_dispatch:
defaults:
run:
working-directory: ./
permissions:
contents: read
actions: read
env:
TURBO_REF_FILTER: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
fetch-depth: 0
- name: Restore Cache
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: cache-${{ hashFiles('package-lock.json') }}-
restore-keys: |
cache-${{ hashFiles('package-lock.json') }}-
cache-
- name: Set up Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install NPM packages
run: npm ci --no-audit --no-fund
- name: Run Linting
run: npx turbo lint --filter="...[$TURBO_REF_FILTER]"
- name: Run Prettier
run: npx turbo prettier --filter="...[$TURBO_REF_FILTER]"
unit-tests:
name: Tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Use GNU tar instead BSD tar
if: matrix.os == 'windows-latest'
shell: cmd
run: echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
- name: Git Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
fetch-depth: 0
- name: Restore Cache
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: cache-${{ hashFiles('package-lock.json') }}-
restore-keys: |
cache-${{ hashFiles('package-lock.json') }}-
cache-
- name: Set up Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Install NPM packages
run: npm ci --no-audit --no-fund
- name: Run Unit Tests (Windows)
if: matrix.os == 'windows-latest'
run: npx turbo test:unit --filter="...[$env:TURBO_REF_FILTER]" -- --coverage
- name: Run Unit Tests (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: npx turbo test:unit --filter="...[$TURBO_REF_FILTER]" -- --coverage
- name: Run Storybook Tests (Windows)
if: matrix.os == 'windows-latest'
run: npx turbo test:storybook --filter="...[$env:TURBO_REF_FILTER]"
- name: Run Storybook Tests (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: npx turbo test:storybook --filter="...[$TURBO_REF_FILTER]"