Run docker tests in separate GitHub tasks

This commit is contained in:
Franck Royer 2021-01-28 15:40:47 +11:00
parent 704a8e7b01
commit 09e0d3b877
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4

View File

@ -86,13 +86,13 @@ jobs:
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
with: with:
path: target path: target
key: rust-${{ matrix.target }}-${{ matrix.rust_toolchain }}-target-directory-${{ hashFiles('Cargo.lock') }}-v1 key: rust-${{ matrix.target }}-target-directory-${{ hashFiles('Cargo.lock') }}-v1
- name: Cache ~/.cargo/registry directory - name: Cache ~/.cargo/registry directory
uses: actions/cache@v1 uses: actions/cache@v1
with: with:
path: ~/.cargo/registry path: ~/.cargo/registry
key: rust-${{ matrix.target }}-${{ matrix.rust_toolchain }}-cargo-registry-directory-${{ hashFiles('Cargo.lock') }}-v1 key: rust-${{ matrix.target }}-cargo-registry-directory-${{ hashFiles('Cargo.lock') }}-v1
- name: Cargo check release code with default features - name: Cargo check release code with default features
run: cargo check --workspace run: cargo check --workspace
@ -100,12 +100,15 @@ jobs:
- name: Cargo check all features - name: Cargo check all features
run: cargo check --workspace --all-targets --all-features run: cargo check --workspace --all-targets --all-features
- name: Cargo test - name: Build tests
if: (!matrix.skip_tests) run: cargo build --tests --workspace --all-features
run: cargo test --workspace --all-features
env: - name: Run monero-harness tests
MONERO_ADDITIONAL_SLEEP_PERIOD: 60000 if: matrix.os == 'ubuntu-latest'
RUST_MIN_STACK: 16777216 # 16 MB. Default is 8MB. This is fine as in tests we start 2 programs: Alice and Bob. run: cargo test --package monero-harness --all-features
- name: Run library tests for swap
run: cargo test --package swap --lib --all-features
- name: Build binary - name: Build binary
run: | run: |
@ -116,3 +119,48 @@ jobs:
with: with:
name: swap-${{ matrix.target }} name: swap-${{ matrix.target }}
path: target/${{ matrix.target }}/debug/swap path: target/${{ matrix.target }}/debug/swap
docker_tests:
env:
TARGET: x86_64-unknown-linux-gnu
strategy:
matrix:
test_name: [
happy_path,
happy_path_restart_alice,
happy_path_restart_bob_after_comm,
happy_path_restart_bob_after_lock_proof_received,
happy_path_restart_bob_before_comm,
punish,
refund_restart_alice_cancelled,
refund_restart_alice,
]
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- 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-${{ env.TARGET }}-target-directory-${{ hashFiles('Cargo.lock') }}-v1
- name: Cache ~/.cargo/registry directory
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: rust-${{ env.TARGET }}-cargo-registry-directory-${{ hashFiles('Cargo.lock') }}-v1
- name: Run test ${{ matrix.test_name }}
run: cargo test --package swap --all-features --test ${{ matrix.test_name }} ""
env:
MONERO_ADDITIONAL_SLEEP_PERIOD: 60000
RUST_MIN_STACK: 16777216 # 16 MB. Default is 8MB. This is fine as in tests we start 2 programs: Alice and Bob.