Skip to content

Commit

Permalink
Add Unit Tests on CI (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
bane authored Oct 2, 2024
1 parent 11bd6b1 commit 40a098d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: CI
on: # yamllint disable-line rule:truthy
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
unit_test:
description: Unit Tests
type: boolean
default: true
workflow_call:
inputs:
unit_test:
description: Unit Tests
type: boolean
required: true

jobs:
unit_test:
name: Unit Tests
uses: ./.github/workflows/unit-test.yml
if: |
inputs.unit_test ||
github.event_name == 'pull_request' ||
(github.event_name == 'push' && github.ref == 'refs/heads/main')
24 changes: 24 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Unit Tests
on: # yamllint disable-line rule:truthy
workflow_call:

jobs:
unit_test:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install packages
run: npm install
- name: Run Tests
run: npx hardhat test
env:
REPORT_GAS: ${{ vars.REPORT_GAS }}

0 comments on commit 40a098d

Please sign in to comment.