Improve documentation and code clarity in LiquidityMath.sol #119
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 workflow will do a clean install of node dependencies, build the source | |
# code and run tests across different versions of node. | |
# | |
# For more information see: | |
# | |
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
# | |
################################################################################ | |
name: Node.js CI | |
# Controls when the action will run. Triggers the workflow on push or pull | |
# request events | |
on: [push, pull_request] | |
# A workflow run is made up of one or more jobs that can run sequentially or in | |
# parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-20.04 | |
node-version: 16 | |
- os: ubuntu-20.04 | |
node-version: 20 | |
- os: ubuntu-22.04 | |
node-version: 16 | |
- os: ubuntu-22.04 | |
node-version: 20 | |
# Steps represent a sequence of tasks that will be executed as part of the | |
# job | |
steps: | |
- name: Build environment information | |
run: 'echo "Matrix OS: ${{ matrix.os }} on $HOSTNAME with $(getconf _NPROCESSORS_ONLN) cores"' | |
# Check-out the repository under $GITHUB_WORKSPACE, so the job can | |
# access it | |
- name: Checkout main repo | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Restore node modules | |
id: restore-node | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
key: node-install-${{ matrix.node-version }}-${{ hashFiles('package.json', 'yarn.lock') }} | |
- name: Restore Solidity compilers | |
id: restore-solc | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/hardhat-nodejs/compilers | |
key: restore-solc-${{ hashFiles('hardhat.config.js') }} | |
- name: Restore smart contract dependencies | |
id: restore-contract-depends | |
uses: actions/cache@v3 | |
with: | |
path: | | |
contracts/bytecode | |
contracts/depends | |
contracts/interfaces | |
key: restore-contract-depends-${{ hashFiles('tools/build-depends.sh', 'tools/depends/**') }} | |
- name: Restore Vyper compilers | |
id: restore-vyper | |
if: steps.restore-contract-depends.outputs.cache-hit != 'true' | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.vvm | |
key: restore-vyper-${{ hashFiles('tools/depends/curve/**', 'tools/depends/curve-dao/**') }} | |
- name: Restore Solidity compilers for Vyper | |
id: restore-solcx | |
if: steps.restore-contract-depends.outputs.cache-hit != 'true' | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.solcx | |
key: restore-solcx-${{ hashFiles('tools/depends/curve/**', 'tools/depends/curve-dao/**') }} | |
- name: Restore smart contract artifacts | |
id: restore-contract-artifacts | |
uses: actions/cache@v3 | |
with: | |
path: | | |
artifacts | |
src/abi | |
src/types | |
key: restore-contract-artifacts-${{ hashFiles('contracts/**', 'requirements.txt', 'tools/build-depends.sh', 'tools/depends/**') }} | |
- name: yarn install | |
if: steps.restore-node.outputs.cache-hit != 'true' | |
run: yarn install | |
- name: yarn audit-ci | |
run: yarn audit-ci | |
- name: yarn prettier | |
run: yarn prettier | |
- name: yarn eslint | |
run: yarn eslint | |
- name: yarn depends | |
if: steps.restore-contract-depends.outputs.cache-hit != 'true' | |
run: yarn depends | |
- name: yarn solhint | |
if: steps.restore-contract-artifacts.outputs.cache-hit != 'true' | |
run: yarn solhint | |
# Set up static analysis | |
- name: Install Python dependencies for slither | |
if: steps.restore-contract-artifacts.outputs.cache-hit != 'true' | |
run: | | |
pip3 install --upgrade pip setuptools | |
pip3 install -r requirements.txt | |
- name: yarn slither | |
if: steps.restore-contract-artifacts.outputs.cache-hit != 'true' | |
run: yarn slither | |
- name: yarn export | |
if: steps.restore-contract-artifacts.outputs.cache-hit != 'true' | |
run: yarn export | |
- name: yarn compile | |
if: steps.restore-contract-artifacts.outputs.cache-hit == 'true' | |
run: yarn compile | |
- name: yarn typescript | |
run: yarn typescript | |
- name: yarn test | |
run: yarn test | |
- name: yarn copy-dts | |
run: yarn copy-dts |