From 5629c1f25e03fde068e85a31ed2a24cfd55735b6 Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Tue, 16 Jun 2020 14:36:45 +0300 Subject: [PATCH] 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 --- .circleci/config.yml | 31 ------------------------- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 31 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 80519ba9..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..fbcd7021 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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