Skip to content

Add vesting wallet and splitter contracts #663

Add vesting wallet and splitter contracts

Add vesting wallet and splitter contracts #663

Workflow file for this run

name: 'CI'
on:
push:
branches:
- main
tags:
- '**'
pull_request:
branches:
- '**'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-lint-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-lint-${{ env.cache-name }}-
- run: npm ci
- run: npm install -g solhint
- run: solhint contracts/**/*.sol
tests_full:
runs-on: ubuntu-latest
steps:
- name: "step-log-ref"
run: |
echo "[C] github.ref: ${{github.ref}}"
- name: "step-log-event_name "
run: |
echo "[C] github.event_name : ${{github.event_name }}"
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-test-unit-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-test-unit-${{ env.cache-name }}-
- run: npm ci
- name: Run Hardhat
run: |
npx hardhat node &
env:
ALCHEMY_URL: ${{secrets.ALCHEMY_URL}}
- name: Compile contracts
run: |
npx hardhat compile --force
env:
ALCHEMY_URL: ${{secrets.ALCHEMY_URL}}
- name: Run tests
run: npm run test:full:cover
env:
ALCHEMY_URL: ${{secrets.ALCHEMY_URL}}
- name: Delete dbg files
run: find ./artifacts/* -name "*.dbg.json" -type f -delete
- uses: actions/upload-artifact@v2
with:
name: coverage
path: coverage/
slither:
name: Slither Analysis
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run Slither
uses: crytic/slither-action@v0.1.0
continue-on-error: true
id: slither
with:
node-version: 16
sarif: results.sarif
env:
ALCHEMY_URL: ${{secrets.ALCHEMY_URL}}`
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ steps.slither.outputs.sarif }}
coverage:
runs-on: ubuntu-latest
needs: [tests_full]
if: ${{ success() && github.actor != 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: coverage
path: coverage/
- uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
if: "${{ env.CC_TEST_REPORTER_ID != '' }}"
with:
coverageLocations: |
${{ github.workspace }}/coverage/lcov.info:lcov
dockerbuild:
runs-on: ubuntu-latest
if: ${{ success() }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: docker build -t "testimage:latest" .
publish-npm:
needs: [lint, tests_full]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- name: Compile contracts
run: |
npx hardhat compile --force
env:
ALCHEMY_URL: ${{secrets.ALCHEMY_URL}}
- name: Delete dbg files
run: find ./artifacts/* -name "*.dbg.json" -type f -delete
- name: Delete useless files
run: rm -rf ./artifacts/build-info/*
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-pypi:
runs-on: ubuntu-latest
needs: [lint, tests_full]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: "step-log-ref"
run: |
echo "[C] github.ref: ${{github.ref}}"
- name: "step-log-event_name "
run: |
echo "[C] github.event_name : ${{github.event_name }}"
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-test-unit-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-test-unit-${{ env.cache-name }}-
- run: npm ci
- name: Compile contracts
run: |
npx hardhat compile --force
env:
ALCHEMY_URL: ${{secrets.ALCHEMY_URL}}
- name: Delete dbg files
run: find ./artifacts/* -name "*.dbg.json" -type f -delete
- name: Delete useless files
run: rm -rf ./artifacts/build-info/*
- name: Copy artifacts to root folder
run: find ./artifacts/contracts -name '*.json' -exec mv '{}' './artifacts/' ';'
- name: Remove folders from artifacts
run: find ./artifacts -maxdepth 1 -mindepth 1 -type d -exec rm -rf '{}' \;
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Create __init__.py files
run: |
find artifacts -type d -exec touch '{}'/__init__.py ';'
find addresses -type d -exec touch '{}'/__init__.py ';'
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}