feat: add ci to bc-fusion contracts and lint code (#431) #3
Workflow file for this run
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
name: Unit Test | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
- bc-fusion | |
pull_request: | |
branches: | |
- master | |
- develop | |
- bc-fusion | |
permissions: | |
contents: read | |
# Optional: allow read access to pull request. Use with `only-new-issues` option. | |
# pull-requests: read | |
jobs: | |
unit-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- uses: actions/cache@v1 | |
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Install Project Dependencies | |
run: | | |
npm install | |
forge install --no-git --no-commit foundry-rs/forge-std@v1.7.3 | |
- name: Lint Check | |
run: | | |
npm run lint:check | |
- name: Build | |
run: | | |
forge build | |
- name: Start Local Chain | |
run: | | |
npm install pm2 -g | |
pm2 start --name local-chain "anvil -f https://bsc-dataseed1.ninicoin.io" | |
sleep 5 | |
env: | |
PORT: 8545 | |
- name: Unit Test | |
run: | | |
forge test --rpc-url http://127.0.0.1:8545 |