xmr-btc-swap/.github/workflows/ci.yml
dependabot[bot] 85712aa95f
build(deps): bump Swatinem/rust-cache from 2.7.2 to 2.7.3
Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from 2.7.2 to 2.7.3.
- [Release notes](https://github.com/swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/swatinem/rust-cache/compare/v2.7.2...v2.7.3)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 11:38:18 +00:00

162 lines
4.5 KiB
YAML

name: CI
on:
pull_request: # Need to run on pull-requests, otherwise PRs from forks don't run
push:
branches:
- "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@v4.1.1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.70"
components: clippy,rustfmt
- uses: Swatinem/rust-cache@v2.7.3
- name: Check formatting
uses: dprint/check@v2.2
with:
dprint-version: 0.39.1
- name: Run clippy with default features
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Run clippy with all features enabled
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
bdk_test:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4.1.1
- uses: Swatinem/rust-cache@v2.7.3
- name: Build swap
run: cargo build --bin swap
- name: Run BDK regression script
run: ./swap/tests/bdk.sh
sqlx_test:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4.1.1
- uses: Swatinem/rust-cache@v2.7.3
- name: Install sqlx-cli
run: cargo install sqlx-cli --locked
- name: Run sqlite_dev_setup.sh script
run: |
cd swap
./sqlite_dev_setup.sh
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@v4.1.1
- uses: Swatinem/rust-cache@v2.7.3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.70"
targets: armv7-unknown-linux-gnueabihf
- name: Build binary
if: matrix.target != 'armv7-unknown-linux-gnueabihf'
run: cargo build -p swap --target ${{ matrix.target }}
- name: Install cross (armv7)
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
run: cargo install cross --locked
- name: Build binary (armv7)
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
run: cross build -p swap --target ${{ matrix.target }}
- name: Upload swap binary
uses: actions/upload-artifact@v4
with:
name: swap-${{ matrix.target }}
path: target/${{ matrix.target }}/debug/swap
- name: Upload asb binary
uses: actions/upload-artifact@v4
with:
name: asb-${{ matrix.target }}
path: target/${{ matrix.target }}/debug/asb
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4.1.1
- uses: Swatinem/rust-cache@v2.7.3
- 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,
happy_path_restart_alice_after_xmr_locked,
alice_and_bob_refund_using_cancel_and_refund_command,
alice_and_bob_refund_using_cancel_then_refund_command,
alice_and_bob_refund_using_cancel_and_refund_command_timelock_not_expired,
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@v4.1.1
- uses: Swatinem/rust-cache@v2.7.3
- name: Run test ${{ matrix.test_name }}
run: cargo test --package swap --all-features --test ${{ matrix.test_name }} -- --nocapture