-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor github action to run without extra docker container
- Loading branch information
Showing
3 changed files
with
36 additions
and
10 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 |
---|---|---|
|
@@ -7,27 +7,52 @@ on: | |
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-18.04 | ||
env: | ||
FORK_MAINNET: ${{ secrets.FORK_MAINNET }} | ||
QUICK_NODE_KEY: ${{ secrets.QUICK_NODE_KEY }} | ||
NODE_OPTIONS: --max-old-space-size=4096 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Clear | ||
run: docker container prune -f && docker image prune -f | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
cache: "yarn" | ||
|
||
- name: Install deps | ||
run: yarn | ||
|
||
- name: Install solidity | ||
run: yarn global add [email protected] | ||
|
||
- name: "Create env file" | ||
run: | | ||
touch .env | ||
echo FORK_MAINNET=${{ secrets.FORK_MAINNET }} >> .env | ||
echo QUICK_NODE_KEY=${{ secrets.QUICK_NODE_KEY }} >> .env | ||
- name: Build docker | ||
run: docker build -t isolated:${GITHUB_SHA::7} . | ||
|
||
- name: Run hardhat compile and tests coverage | ||
run: docker run --name ${GITHUB_SHA::7} isolated:${GITHUB_SHA::7} bash -c "yarn hardhat:compile && yarn hardhat:coverage && yarn hardhat:coverage-validator" | ||
run: | | ||
source .env | ||
yarn hardhat:compile && yarn hardhat:coverage | ||
- name: Code Coverage Report | ||
uses: irongut/[email protected] | ||
with: | ||
filename: coverage/**/cobertura-coverage.xml | ||
badge: true | ||
fail_below_min: false | ||
format: markdown | ||
hide_branch_rate: false | ||
hide_complexity: true | ||
indicators: true | ||
output: both | ||
thresholds: '50 80' | ||
|
||
- name: Clear | ||
run: docker rm ${GITHUB_SHA::7} | ||
- name: Add Coverage PR Comment | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
recreate: true | ||
path: code-coverage-results.md |
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
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 |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
"test": "yarn remove ethers && yarn remove ethereum-waffle && rebuild=true ./script/test && yarn add [email protected] && yarn add [email protected]", | ||
"hardhat:test": "hardhat test", | ||
"hardhat:compile": "hardhat compile", | ||
"hardhat:coverage": "hardhat coverage ", | ||
"hardhat:coverage": "hardhat coverage", | ||
"lint:sol": "solhint --max-warnings 0 \"contracts/**/*.sol\"", | ||
"lint:sol:fix": "prettier --write \"contracts/**/*.sol\"", | ||
"build": "rm -rf dist && tsc --declaration && hardhat compile && cp -r ./{package.json,yarn.lock,artifacts,networks,contracts,deployments} dist/", | ||
|