Skip to content

Merge pull request #207 from batijs/renovate/all-minor-patch #592

Merge pull request #207 from batijs/renovate/all-minor-patch

Merge pull request #207 from batijs/renovate/all-minor-patch #592

Workflow file for this run

name: Tests
on:
pull_request:
push:
# Ensures cache is computed on main branch so that it can be reused on all PRs
branches: [ "main" ]
jobs:
cache-and-install:
runs-on: ${{ matrix.os }}
services:
verdaccio:
# See https://github.com/actions/runner/issues/822#issuecomment-1524826092
image: ${{ (matrix.os == 'ubuntu-latest') && 'verdaccio/verdaccio' || '' }}
ports:
- 4873:4873
strategy:
matrix:
node: ["18", "20"]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- uses: oven-sh/setup-bun@v1
# At the moment of writing:
# - bun does not support Windows
if: matrix.os != 'windows-latest'
name: Install bun
with:
bun-version: "1.0.26"
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: mkdir temp folder
run: mkdir -p ${{ runner.temp }}/bati-cache
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: actions/cache@v4
name: Setup Turborepo cache
with:
path: ${{ runner.temp }}/bati-cache
key: ${{ runner.os }}-${{ matrix.node }}-bati-cache-${{ github.event.repository.updated_at }}
restore-keys: |
${{ runner.os }}-${{ matrix.node }}-bati-cache-
- name: Install global dependencies
if: matrix.os == 'ubuntu-latest'
run: pnpm install --global npm-cli-login
- name: Login to verdaccio
if: matrix.os == 'ubuntu-latest'
run: npm-cli-login
env:
NPM_USER: bati
NPM_PASS: bati
NPM_EMAIL: [email protected]
NPM_REGISTRY: http://localhost:4873
- name: Install dependencies
run: pnpm install
- name: Build packages
run: pnpm run build
- name: Release in local repo
if: matrix.os == 'ubuntu-latest'
run: pnpm run release:local
- name: Run check types
run: pnpm run check-types
- name: Run tests
run: pnpm run test
- name: Run e2e tests
run: pnpm run test:e2e