Build and Test #3288
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 does a build and test of all packages | |
name: Build and Test | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "README.md" | |
pull_request: | |
paths-ignore: | |
- "README.md" | |
schedule: | |
- cron: "0 20 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and test | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 8.15.9 | |
- name: setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "20.*" | |
cache: "pnpm" | |
# Why do we explicitly do pnpm install here and not use "run_install: true" above in the pnpm setup? | |
# We need to have pnpm setup before node in order to take advantage of the inbuilt caching that is available | |
# in that action, and running an install as part of pnpm setup won't use the cache, so we'll explicitly | |
# run it here after the cache | |
- run: pnpm install | |
- name: Lint | |
run: pnpm lint | |
- name: Build | |
run: pnpm build | |
- name: Check that action dist folders are up to date | |
run: pnpm ci:checkdist | |
- name: Test | |
run: pnpm test | |
publish: | |
runs-on: ubuntu-latest | |
name: Publish actions | |
needs: build | |
# Only run publishing on commits that perform versioning | |
if: ${{ startsWith(github.event.commits[0].message, 'Version Packages') }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 8.15.9 | |
- name: setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "20.*" | |
cache: "pnpm" | |
# Why do we explicitly do pnpm install here and not use "run_install: true" above in the pnpm setup? | |
# We need to have pnpm setup before node in order to take advantage of the inbuilt caching that is available | |
# in that action, and running an install as part of pnpm setup won't use the cache, so we'll explicitly | |
# run it here after the cache | |
- run: pnpm install | |
- run: pnpm build | |
- name: Publish | |
uses: changesets/[email protected] | |
with: | |
publish: pnpm run ci:publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |