Enable caching feature of wireit in GitHub Actions #200
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
# Expose some environment variables for wireit | |
- uses: google/wireit@setup-github-actions-caching/v1 | |
- run: npm ci | |
- name: Build | |
# `unified-latex-cli` depends on almost all `unified-latex` packages. We build it first | |
# so that if it errors, the build will fail. | |
run: | | |
npm run build -w packages/unified-latex-cli | |
npm run build -ws --if-present | |
- name: Test | |
run: npm test | |
# This test tests the actual packages that will be distributed | |
- name: Test Packages run on ESM and CJS | |
run: | | |
npm run test:packages-install | |
npm run test:packages-esm | |
npm run test:packages-cjs |