2020-09-28 02:18:50 -04:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'staging'
|
|
|
|
- 'trying'
|
|
|
|
- 'master'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
static_analysis:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
components: rustfmt, clippy
|
|
|
|
|
|
|
|
- name: Cache ~/.cargo/bin directory
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/bin
|
|
|
|
key: ubuntu-rust-${{ env.RUST_TOOLCHAIN }}-cargo-bin-directory-v1
|
|
|
|
|
|
|
|
- name: Install tomlfmt
|
|
|
|
run: which cargo-tomlfmt || cargo install cargo-tomlfmt
|
|
|
|
|
|
|
|
- name: Check Cargo.toml formatting
|
|
|
|
run: |
|
|
|
|
cargo tomlfmt -d -p Cargo.toml
|
|
|
|
cargo tomlfmt -d -p xmr-btc/Cargo.toml
|
|
|
|
cargo tomlfmt -d -p monero-harness/Cargo.toml
|
|
|
|
|
|
|
|
- name: Check code formatting
|
|
|
|
run: cargo fmt --all -- --check
|
|
|
|
|
2020-10-27 20:18:14 -04:00
|
|
|
- name: Run clippy with default features
|
2020-10-27 01:02:32 -04:00
|
|
|
run: cargo clippy --workspace --all-targets -- -D warnings
|
|
|
|
|
2020-10-27 20:18:14 -04:00
|
|
|
- name: Run clippy with all features enabled (e.g. tor)
|
2020-09-28 02:18:50 -04:00
|
|
|
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
|
|
|
|
|
|
|
|
build_test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-10-19 23:33:32 -04:00
|
|
|
|
2020-09-28 02:18:50 -04:00
|
|
|
- name: Checkout sources
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-10-21 02:53:49 -04:00
|
|
|
- name: Install and stop tor in case it was running
|
|
|
|
run: |
|
|
|
|
sudo apt install software-properties-common
|
|
|
|
sudo curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | sudo gpg --import
|
|
|
|
sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
|
|
|
|
sudo add-apt-repository 'deb https://deb.torproject.org/torproject.org bionic main'
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install tor deb.torproject.org-keyring
|
|
|
|
sudo /etc/init.d/tor stop
|
|
|
|
|
2020-09-28 02:18:50 -04:00
|
|
|
- name: Install Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- name: Cache target directory
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: target
|
|
|
|
key: rust-${{ matrix.rust_toolchain }}-target-directory-${{ hashFiles('Cargo.lock') }}-v1
|
|
|
|
|
|
|
|
- name: Cache ~/.cargo/registry directory
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~/.cargo/registry
|
|
|
|
key: rust-${{ matrix.rust_toolchain }}-cargo-registry-directory-${{ hashFiles('Cargo.lock') }}-v1
|
|
|
|
|
|
|
|
- name: Cargo check release code with default features
|
|
|
|
run: cargo check --workspace
|
|
|
|
|
|
|
|
- name: Cargo check all features
|
|
|
|
run: cargo check --workspace --all-targets --all-features
|
|
|
|
|
|
|
|
- name: Cargo test
|
2020-10-08 18:57:28 -04:00
|
|
|
run: cargo test --workspace --all-features
|
2020-10-08 20:05:04 -04:00
|
|
|
env:
|
2020-10-21 00:52:51 -04:00
|
|
|
# To avoid stack overflows
|
|
|
|
RUST_MIN_STACK: 100000000
|
2020-10-08 20:05:04 -04:00
|
|
|
MONERO_ADDITIONAL_SLEEP_PERIOD: 60000
|