fix: mint erc20 #5
This file contains hidden or 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: Build and Test Smart Contracts | |
| on: | |
| pull_request: {} | |
| push: | |
| branches: | |
| - main | |
| release: | |
| types: [created] | |
| jobs: | |
| build-and-test: | |
| name: Build and Test Contracts | |
| runs-on: ubuntu-latest | |
| environment: dev | |
| env: | |
| INFURA_API_KEY: ${{ vars.INFURA_API_KEY }} | |
| OWNER_ADDRESS: ${{ vars.OWNER_ADDRESS }} | |
| TOKEN_CREATOR_FEE: ${{ vars.TOKEN_CREATOR_FEE }} | |
| FEE_RECEIVER_ADDRESS: ${{ vars.FEE_RECEIVER_ADDRESS }} | |
| ETHERSCAN_KEY: ${{ vars.ETHERSCAN_KEY }} | |
| ALCHEMY_API_KEY: ${{ vars.ALCHEMY_API_KEY }} | |
| TATUM_API_KEY: ${{ vars.TATUM_API_KEY }} | |
| PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Compile contracts | |
| run: npm run compile | |
| - name: Run unit tests | |
| run: npm run test | |
| - name: Check code formatting | |
| run: npm run format:check | |
| check-branch: | |
| name: Check branch for release | |
| if: github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fail if not on main branch | |
| run: | | |
| if [[ "${{ github.ref }}" != "refs/heads/main" && "${{ github.event.release.target_commitish }}" != "main" ]]; then | |
| echo "Releases are only allowed from the main branch." | |
| exit 1 | |
| fi |