box it up #2804
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: Contract tests | |
on: [push] | |
concurrency: | |
# limit concurrency of entire workflow runs for a specific branch | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
contract_tests: | |
name: Contract tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: pnpm/action-setup@v4 | |
- name: Set Node Version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 22.1.0 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
working-directory: ./contracts | |
- name: Type checks | |
run: pnpm typecheck | |
working-directory: ./contracts | |
- name: Tests | |
run: pnpm test | |
working-directory: ./contracts | |
- name: Lint | |
run: pnpm lint | |
working-directory: ./contracts | |
- name: Generate contract docs and types | |
run: pnpm build | |
working-directory: ./contracts | |
- name: Ensure git is clean | |
id: gitStatus | |
run: git diff --no-ext-diff --exit-code | |
continue-on-error: true | |
- name: Error message if git is dirty | |
if: steps.gitStatus.outcome == 'failure' | |
run: | | |
echo "::error::Git is dirty. Make sure you ran \`make build\` before pushing." | |
exit 1 |