Skip to content

Test Packages

Test Packages #366

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Test Packages
on:
push:
branches: ['main']
pull_request:
branches: ['main']
jobs:
yarn:
name: Install dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache Node.js modules
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ runner.arch }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- name: Setup Node.js
if: steps.cache.outputs.cache-hit != 'true'
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: Yarn install
if: steps.cache.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile
test:
name: Test repository
runs-on: ubuntu-latest
needs: yarn
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Restore Node.js modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ runner.arch }}-node-modules-${{ hashFiles('**/yarn.lock') }}
fail-on-cache-miss: true
- name: Cache Trubo
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-${{ runner.arch }}-turbo-test-${{ hashFiles('**/yarn.lock') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-turbo-test-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-${{ runner.arch }}-turbo-test
- name: Yarn test
run: yarn test --cache-dir=.turbo
lint:
name: Lint repository
runs-on: ubuntu-latest
needs: yarn
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Restore Node.js modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ runner.arch }}-node-modules-${{ hashFiles('**/yarn.lock') }}
fail-on-cache-miss: true
- name: Cache Trubo
uses: actions/cache@v3
with:
path: .turbo
key: ${{ runner.os }}-${{ runner.arch }}-turbo-lint-${{ hashFiles('**/yarn.lock') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-turbo-lint-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-${{ runner.arch }}-turbo-lint
- name: Yarn lint:strict
run: yarn lint:strict --cache-dir=.turbo