xmr-btc-swap/.github/workflows/ci.yml

120 lines
3.5 KiB
YAML
Raw Normal View History

name: CI
on:
2021-03-23 20:30:51 -04:00
pull_request: # Need to run on pull-requests, otherwise PRs from forks don't run
push:
branches:
2021-03-23 20:30:51 -04:00
- 'staging' # Bors uses this branch
- 'trying' # Bors uses this branch
- 'master' # Always build head of master for the badge in the README
jobs:
static_analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3.0.0
- uses: Swatinem/rust-cache@v1.4.0
- name: Check formatting
uses: dprint/check@v2.0
- name: Run clippy with default features
run: cargo clippy --workspace --all-targets -- -D warnings
2021-02-14 18:11:41 -05:00
- name: Run clippy with all features enabled
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v3.0.0
- uses: Swatinem/rust-cache@v1.4.0
2021-03-11 19:25:30 -05:00
- name: Install compiler for armhf arch
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
- name: Build binary
run: |
cargo build -p swap --target ${{ matrix.target }}
2021-03-05 00:14:21 -05:00
- name: Upload swap binary
uses: actions/upload-artifact@v2-preview
with:
name: swap-${{ matrix.target }}
2021-03-05 00:14:21 -05:00
path: target/${{ matrix.target }}/debug/swap
- name: Upload asb binary
uses: actions/upload-artifact@v2-preview
with:
name: asb-${{ matrix.target }}
path: target/${{ matrix.target }}/debug/asb
test:
strategy:
matrix:
2021-03-24 01:02:43 -04:00
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v3.0.0
- uses: Swatinem/rust-cache@v1.4.0
- name: Build tests
run: cargo build --tests --workspace --all-features
- name: Run monero-harness tests
if: matrix.os == 'ubuntu-latest'
run: cargo test --package monero-harness --all-features
- name: Run library tests for swap
run: cargo test --package swap --lib --all-features
docker_tests:
strategy:
matrix:
test_name: [
happy_path,
happy_path_restart_bob_after_xmr_locked,
happy_path_restart_bob_before_xmr_locked,
2021-03-26 00:38:30 -04:00
happy_path_restart_alice_after_xmr_locked,
alice_and_bob_refund_using_cancel_and_refund_command,
alice_and_bob_refund_using_cancel_and_refund_command_timelock_not_expired,
2021-03-26 00:38:30 -04:00
punish,
alice_punishes_after_restart_bob_dead,
alice_manually_punishes_after_bob_dead,
alice_refunds_after_restart_bob_refunded,
ensure_same_swap_id,
concurrent_bobs_before_xmr_lock_proof_sent,
alice_manually_redeems_after_enc_sig_learned
]
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3.0.0
- uses: Swatinem/rust-cache@v1.4.0
- name: Run test ${{ matrix.test_name }}
2021-04-19 23:03:59 -04:00
run: cargo test --package swap --all-features --test ${{ matrix.test_name }} -- --nocapture