Merge pull request #6 from 0xmichalis/ci-workflow #1
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: faucet tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
if: github.event.pull_request.draft == false | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | |
- name: Check yarn cache | |
uses: actions/cache@v2 | |
id: cache-yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Check node_modules cache | |
id: cache-node-modules | |
uses: actions/cache@v2 | |
with: | |
path: | | |
node_modules | |
*/*/node_modules | |
key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.node-version }}-nodemodules- | |
- name: Install packages | |
run: yarn install --immutable | |
- name: Build contracts | |
run: yarn hardhat compile | |
- name: Test contracts | |
run: yarn hardhat test | |
env: | |
MUMBAI_URL: ${{ secrets.MUMBAI_RPC_URL }} | |
- name: Deploy contracts | |
run: yarn hardhat deploy --network hardhat |