build: add yarn cache to github workflow caching #201
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
# 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: Node.js lint | |
on: | |
push: | |
branches: ['main'] | |
pull_request: | |
branches: ['main'] | |
permissions: | |
id-token: write | |
attestations: write | |
jobs: | |
lint_typecheck: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
attestations: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup nodejs | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Cache node_modules | |
id: node-modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
example/node_modules | |
.yarn/cache | |
key: node-modules | |
- run: yarn | |
- run: yarn lint | |
- run: yarn typecheck | |
- run: yarn pack --out '%s_%v.tgz' | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: package | |
path: '${{ github.workspace }}/*.tgz' | |
- name: Attest | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-path: '${{ github.workspace }}/*.tgz' |