Skip to content

README.md

README.md #79

Workflow file for this run

name: Hardhat Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
# Node.js versions
node-version: [18, 20]
# Hardhat releases: https://github.com/NomicFoundation/hardhat/releases
hardhat-version: [2.22] # Keep ONLY ONE version.
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Init NPM Project
run: npm init -y
- name: Install Hardhat
run: npm install --save-dev hardhat@${{ matrix.hardhat-version }}
- name: Install NPM Dependencies
run: npm install
- name: Compile Hardhat Contracts
run: npx hardhat compile
- name: Debug Environment
run: |
echo "Current directory: $(pwd)"
echo "PATH: $PATH"
echo "Hardhat version: $(npx hardhat --version)"
echo "Node.js version: $(node --version)"
echo "Solidity version: $(npx hardhat run scripts/getSolidityVersion.ts)"
- name: Run Hardhat Tests
run: npx hardhat test
- name: Run Gas Reporter
run: npx hardhat test
env:
REPORT_GAS: true