-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a6b721e
commit cd8c200
Showing
2 changed files
with
154 additions
and
154 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
on: | ||
push: | ||
branches: | ||
- feature/* | ||
- bugfix/* | ||
- develop | ||
- release/* | ||
- hotfix/* | ||
- main | ||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Init | ||
run: npm ci | ||
- name: Run coverage | ||
run: npm run coverage | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: iExecBlockchainComputing/iexec-voucher-contracts | ||
- name: Run static analysis with slither | ||
uses: crytic/[email protected] | ||
id: slither | ||
with: | ||
target: "contracts/" | ||
slither-args: --checklist --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/ | ||
node-version: "20" | ||
fail-on: none # TODO set this to high or other | ||
sarif: results.sarif | ||
- name: Upload SARIF file | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: ${{ steps.slither.outputs.sarif }} | ||
push: | ||
branches: | ||
- feature/* | ||
- bugfix/* | ||
- develop | ||
- release/* | ||
- hotfix/* | ||
- main | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Init | ||
run: npm ci | ||
- name: Run coverage | ||
run: npm run coverage | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: iExecBlockchainComputing/iexec-voucher-contracts | ||
- name: Run static analysis with slither | ||
uses: crytic/[email protected] | ||
id: slither | ||
with: | ||
target: "contracts/" | ||
slither-args: --checklist --markdown-root ${{ github.server_url }}/${{ github.repository }}/blob/${{ github.sha }}/ | ||
node-version: "20" | ||
fail-on: none # TODO set this to high or other | ||
sarif: results.sarif | ||
- name: Upload SARIF file | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: ${{ steps.slither.outputs.sarif }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,122 +1,122 @@ | ||
name: Voucher Smart Contract CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- '**' | ||
push: | ||
branches: | ||
- main | ||
- "**" | ||
|
||
jobs: | ||
install-deps: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: | | ||
node -v | ||
npm -v | ||
npm ci | ||
bellecour-fork: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Start bellecour fork | ||
run: | | ||
docker run -d --name bellecour-fork -p 8545:8545 ghcr.io/foundry-rs/foundry:latest \ | ||
anvil --host 0.0.0.0 --port 8545 --hardfork berlin --fork-url https://bellecour.iex.ec --chain-id 134 --gas-limit 6700000 --gas-price 0 | ||
bellecour-fork-healthy: | ||
runs-on: ubuntu-latest | ||
needs: bellecour-fork | ||
steps: | ||
- name: Wait for bellecour fork to be ready | ||
run: | | ||
while ! nc -z 127.0.0.1 8545; do sleep 1; done | ||
echo "Bellecour fork ready" | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
check-format: | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Check format | ||
run: npm run check-format | ||
|
||
uml-diagrams: | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Generate UML diagrams | ||
run: npm run uml | ||
|
||
static-analyzer: | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Clone and run static analyzer | ||
run: | | ||
git clone https://github.com/Picodes/4naly3er.git | ||
cd 4naly3er | ||
git reset --hard HEAD~1 # FIX issue https://github.com/Picodes/4naly3er/issues/48 | ||
yarn install | ||
yarn analyze ../contracts | ||
hardhat-tests: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
- bellecour-fork-healthy | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Run Hardhat tests | ||
run: npm run test-ci | ||
install-deps: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: | | ||
node -v | ||
npm -v | ||
npm ci | ||
bellecour-fork: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Start bellecour fork | ||
run: | | ||
docker run -d --name bellecour-fork -p 8545:8545 ghcr.io/foundry-rs/foundry:latest \ | ||
anvil --host 0.0.0.0 --port 8545 --hardfork berlin --fork-url https://bellecour.iex.ec --chain-id 134 --gas-limit 6700000 --gas-price 0 | ||
bellecour-fork-healthy: | ||
runs-on: ubuntu-latest | ||
needs: bellecour-fork | ||
steps: | ||
- name: Wait for bellecour fork to be ready | ||
run: | | ||
while ! nc -z 127.0.0.1 8545; do sleep 1; done | ||
echo "Bellecour fork ready" | ||
build: | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Build | ||
run: npm run build | ||
|
||
check-format: | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Check format | ||
run: npm run check-format | ||
|
||
uml-diagrams: | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Generate UML diagrams | ||
run: npm run uml | ||
|
||
static-analyzer: | ||
runs-on: ubuntu-latest | ||
needs: install-deps | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Clone and run static analyzer | ||
run: | | ||
git clone https://github.com/Picodes/4naly3er.git | ||
cd 4naly3er | ||
git reset --hard HEAD~1 # FIX issue https://github.com/Picodes/4naly3er/issues/48 | ||
yarn install | ||
yarn analyze ../contracts | ||
hardhat-tests: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
- bellecour-fork-healthy | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Run Hardhat tests | ||
run: npm run test-ci |