Skip to content

Commit

Permalink
CI workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
darcys22 committed Nov 27, 2023
1 parent 959aaec commit 297fac6
Show file tree
Hide file tree
Showing 4 changed files with 4,101 additions and 2 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Ubuntu C++ Tests
on: [push]

jobs:
tests:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install Yarn dependencies and build
run: |
yarn
yarn build
- name: Start Hardhat node in background
run: |
yarn node &
echo "NODE_PID=$!" >> $GITHUB_ENV
- name: Install prerequisites for C++ build
run: sudo apt-get update && sudo apt-get install -y cmake build-essential libboost-all-dev libssl-dev libcurl4-openssl-dev libsodium-dev

- name: Create and change into Build Directory
run: |
mkdir -p test/cpp/build
cd test/cpp/build
- name: CMake Generate
run: cmake -B. -H..

- name: Compile
run: cmake --build .

- name: Run C++ tests
run: ctest -VV --repeat until-pass:2 --test-dir .

- name: Kill Yarn node
run: kill $NODE_PID
if: always()

18 changes: 18 additions & 0 deletions .github/workflows/hardhat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Ubuntu Hardhat Tests
on: [push]

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn
- run: yarn build
- run: yarn test
31 changes: 29 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
{
"name": "hardhat-project",
"name": "service-node-rewards-contracts",
"version": "1.0.0",
"description": "A smart contract that manages BLS public keys and pays rewards for the Oxen Service Node Network",
"scripts": {
"build": "hardhat compile",
"test": "hardhat test",
"deploy": "hardhat deploy --network",
"coverage": "hardhat coverage",
"lint": "yarn lint:sol && yarn lint:ts",
"lint:sol": "solhint 'contracts/**/*.sol'",
"lint:ts": "eslint --max-warnings 0 .",
"fmt:sol": "prettier 'contracts/**/*.sol' -w",
"prepack": "yarn build"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.2",
"@nomicfoundation/hardhat-ethers": "^3.0.5",
"@nomicfoundation/hardhat-network-helpers": "^1.0.9",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"hardhat": "^2.18.1"
"@nomicfoundation/hardhat-verify": "^1.1.1",
"@typechain/ethers-v6": "^0.4.3",
"@typechain/hardhat": "^8.0.3",
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
"chai": "^4.3.10",
"hardhat": "^2.18.1",
"hardhat-gas-reporter": "^1.0.9",
"solidity-coverage": "^0.8.5",
"ts-node": "^10.9.1",
"typechain": "^8.3.2",
"typescript": "^5.3.2"
},
"dependencies": {
"@openzeppelin/contracts": "^5.0.0"
Expand Down
Loading

0 comments on commit 297fac6

Please sign in to comment.