automatic issue opening #98
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: Build and Test | |
on: | |
pull_request: | |
jobs: | |
Deploy-Test: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' # This line ensures that this job only runs on pull requests | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.15.0' | |
- name: Restore cache | |
id: restore-cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install HardHat | |
if: steps.restore-cache.outputs.cache-hit != 'true' | |
run: npm i hardhat | |
- name: compile contracts | |
run: npx hardhat compile | |
- name: deployment and testing | |
run: npx hardhat test |