ci: switch to github actions (#18)

Switching to Github actions since Circle would often run out of memory while linking, e.g. https://app.circleci.com/pipelines/github/gakonst/ethers-rs/63/workflows/0eb4236c-ba46-46ab-af9f-21878101434b/jobs/65
This commit is contained in:
Georgios Konstantopoulos 2020-06-16 14:36:45 +03:00 committed by GitHub
parent 5d92e72882
commit 5629c1f25e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 31 deletions

View File

@ -1,31 +0,0 @@
version: 2.1
commands:
setup-lints:
steps:
- run:
name: Install clippy
command: rustup component add clippy
jobs:
build:
docker:
- image: circleci/rust:latest
steps:
- checkout
- setup-lints
- run:
name: Reduce codegen Units
# If we don't include this, the linker runs out of memory when building
# the project on CI. We don't include this normally though because
# it should be able to build with more units on other machines
command: printf "[profile.dev]\ncodegen-units = 1\n" >> Cargo.toml
- run:
name: tests
# skip these temporarily until we get ganache-cli and solc on CI
command: cargo test --all -- --skip deploy_and_call_contract --skip send_eth --skip watch_events --skip get_past_events --skip test_pending_tx
- run:
name: Check style
command: |
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings

49
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,49 @@
on: push
name: Tests
# set for fetching ABIs for abigen from etherscan
env:
ETHERSCAN_API_KEY: ${{ secrets.ETHERSCAN_API_KEY }}
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
- 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
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy -- -D warnings