2020-07-03 16:52:09 +00:00
|
|
|
on: pull_request
|
2020-06-16 11:36:45 +00:00
|
|
|
|
|
|
|
name: Tests
|
|
|
|
|
2020-07-03 16:52:09 +00:00
|
|
|
# Yeah I know it's bad practice to have API keys, this is a read-only API key
|
|
|
|
# so that we do not get rate limited by Etherscan (and it's free to generate as
|
|
|
|
# many as you want)
|
2020-06-16 11:36:45 +00:00
|
|
|
env:
|
2020-09-20 15:17:02 +00:00
|
|
|
ETHERSCAN_API_KEY: I5BXNZYP5GEDWFINGVEZKYIVU2695NPQZB
|
2020-06-16 11:36:45 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
name: Check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install ganache-cli
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 10
|
|
|
|
- name: Install ganache
|
|
|
|
run: npm install -g ganache-cli
|
|
|
|
- name: Install Solc
|
|
|
|
run: |
|
|
|
|
mkdir -p "$HOME/bin"
|
|
|
|
wget -q https://github.com/ethereum/solidity/releases/download/v0.6.6/solc-static-linux -O $HOME/bin/solc
|
|
|
|
chmod u+x "$HOME/bin/solc"
|
|
|
|
export PATH=$HOME/bin:$PATH
|
|
|
|
solc --version
|
|
|
|
|
2020-10-24 08:13:13 +00:00
|
|
|
- name: Install geth
|
|
|
|
run: |
|
|
|
|
mkdir -p "$HOME/bin"
|
|
|
|
wget -q https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.23-8c2f2715.tar.gz
|
|
|
|
tar -xvf geth-linux-amd64-1.9.23-8c2f2715.tar.gz
|
|
|
|
mv geth-linux-amd64-1.9.23-8c2f2715/geth $HOME/bin/geth
|
|
|
|
chmod u+x "$HOME/bin/geth"
|
|
|
|
export PATH=$HOME/bin:$PATH
|
|
|
|
geth version
|
2020-06-16 11:36:45 +00:00
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
- name: cargo test
|
|
|
|
run: |
|
|
|
|
export PATH=$HOME/bin:$PATH
|
|
|
|
cargo test
|
|
|
|
|
2020-12-31 17:19:14 +00:00
|
|
|
feature-tests:
|
|
|
|
name: Check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install ganache-cli
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 10
|
|
|
|
# TODO: can we combine these shared steps in github actions?
|
|
|
|
- name: Install ganache
|
|
|
|
run: npm install -g ganache-cli
|
|
|
|
- name: Install Solc
|
|
|
|
run: |
|
|
|
|
mkdir -p "$HOME/bin"
|
|
|
|
wget -q https://github.com/ethereum/solidity/releases/download/v0.6.6/solc-static-linux -O $HOME/bin/solc
|
|
|
|
chmod u+x "$HOME/bin/solc"
|
|
|
|
export PATH=$HOME/bin:$PATH
|
|
|
|
solc --version
|
|
|
|
- name: Install geth
|
|
|
|
run: |
|
|
|
|
mkdir -p "$HOME/bin"
|
|
|
|
wget -q https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.23-8c2f2715.tar.gz
|
|
|
|
tar -xvf geth-linux-amd64-1.9.23-8c2f2715.tar.gz
|
|
|
|
mv geth-linux-amd64-1.9.23-8c2f2715/geth $HOME/bin/geth
|
|
|
|
chmod u+x "$HOME/bin/geth"
|
|
|
|
export PATH=$HOME/bin:$PATH
|
|
|
|
geth version
|
|
|
|
|
|
|
|
- name: Install libusb (for Ledger)
|
|
|
|
run: sudo apt update && sudo apt install pkg-config libudev-dev
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
2020-06-17 09:22:01 +00:00
|
|
|
- name: cargo test (Celo)
|
|
|
|
run: |
|
|
|
|
export PATH=$HOME/bin:$PATH
|
2020-09-24 21:33:09 +00:00
|
|
|
cargo test --all-features
|
2020-06-17 09:22:01 +00:00
|
|
|
|
2020-12-31 17:19:14 +00:00
|
|
|
lint:
|
|
|
|
name: Check
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install stable toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
2020-06-16 11:36:45 +00:00
|
|
|
- name: cargo fmt
|
|
|
|
run: cargo fmt --all -- --check
|
|
|
|
- name: cargo clippy
|
|
|
|
run: cargo clippy -- -D warnings
|