feat: Improve protection logic #4578
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: Unit Tests | |
env: | |
NEXT_PUBLIC_ALCHEMY_ID: ${{ secrets.NEXT_PUBLIC_ALCHEMY_ID }} | |
# Triggers the workflow on push or pull request events | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
unit-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Copy .env vars | |
run: cp .env.default .env.local | |
- name: Set env | |
run: echo "NEXT_PUBLIC_ALCHEMY_ID=$(echo $NEXT_PUBLIC_ALCHEMY_ID | cut -c 1-6)" >> $NEXT_PUBLIC_ALCHEMY_ID | |
- name: Install | |
run: npm ci | |
- name: Generate kubb files | |
run: npm run generate | |
- name: Lint | |
run: npm run lint | |
- name: Run unit tests | |
run: npm run hardhat & npm run test |