Added support for running with different builder #53
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: Tests | |
on: | |
pull_request: | |
push: | |
permissions: | |
contents: read | |
jobs: | |
tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- uses: pnpm/action-setup@v3 | |
with: | |
version: 8 | |
- name: Install and Build | |
run: pnpm i | |
- name: Validate Dist | |
id: diff | |
run: | | |
if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then | |
echo "Detected uncommitted changes after build. See status below:" | |
git diff --ignore-space-at-eol --text dist/ | |
exit 1 | |
fi | |
# If `dist/` was different than expected, upload it | |
- if: ${{ failure() && steps.diff.outcome == 'failure' }} | |
name: Upload Artifact | |
id: upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
retention-days: 10 | |
- name: Run Tests | |
run: pnpm run test |