Regression Contract Tests #70
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: Regression Contract Tests | |
on: | |
workflow_dispatch | |
jobs: | |
check-secrets: | |
runs-on: ubuntu-latest | |
outputs: | |
available: ${{ steps.check.outputs.available }} | |
steps: | |
- id: check | |
env: | |
KEY1: '${{ secrets.GW_MAINNET_V1_PK1 }}' | |
KEY2: '${{ secrets.GW_MAINNET_V1_PK2 }}' | |
if: ${{ env.KEY1 != '' && env.KEY2 != '' }} | |
run: echo "available=true" >> $GITHUB_OUTPUT | |
contract-tests: | |
runs-on: ubuntu-latest | |
needs: check-secrets | |
if: needs.check-secrets.outputs.available | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Node Cache | |
uses: actions/cache@v3 | |
id: npm-and-yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: | | |
${{ steps.yarn-cache-dir-path.outputs.dir }} | |
~/.npm | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('/home/runner/work/**/package-lock.json', '/home/runner/work/**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-node_modules- | |
- name: Install dependencies | |
working-directory: contracts | |
run: npm install | |
- name: Run tests on v1.mainnet.godwoken.io | |
working-directory: contracts | |
run: | | |
npm run test:gw_mainnet_v1 | |
env: | |
PRIVATE_KEY: ${{ secrets.GW_MAINNET_V1_PK1 }} | |
PRIVATE_KEY2: ${{ secrets.GW_MAINNET_V1_PK2 }} | |
- name: Run tests on mainnet-readonly.godwoken.cf | |
working-directory: contracts | |
run: | | |
sed -i "s|v1.mainnet.godwoken.io|mainnet-readonly.godwoken.cf|g" hardhat.config.js | |
npm run test:gw_mainnet_v1 | |
env: | |
PRIVATE_KEY: ${{ secrets.GW_MAINNET_V1_PK1 }} | |
PRIVATE_KEY2: ${{ secrets.GW_MAINNET_V1_PK2 }} |