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