Merge pull request #40 from comit-network/attach-bins

Attach binaries when doing CI run
This commit is contained in:
rishflab 2020-11-12 11:33:20 +11:00 committed by GitHub
commit 5cb2f451d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,13 +48,23 @@ jobs:
run: cargo clippy --workspace --all-targets --all-features -- -D warnings run: cargo clippy --workspace --all-targets --all-features -- -D warnings
build_test: build_test:
runs-on: ubuntu-latest strategy:
matrix:
target: [ x86_64-unknown-linux-gnu, x86_64-apple-darwin ]
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
skip_tests: true # Most likely do not work due to docker usage, TODO: add feature flag to allow unit tests
runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout sources - name: Checkout sources
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install and stop tor in case it was running - name: Install and stop tor in case it was running
if: (matrix.os == 'ubuntu-latest' && !matrix.skip_tests)
run: | run: |
sudo apt install software-properties-common sudo apt install software-properties-common
sudo curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | sudo gpg --import sudo curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | sudo gpg --import
@ -72,15 +82,16 @@ jobs:
- name: Cache target directory - name: Cache target directory
uses: actions/cache@v1 uses: actions/cache@v1
if: matrix.os == 'ubuntu-latest'
with: with:
path: target path: target
key: rust-${{ matrix.rust_toolchain }}-target-directory-${{ hashFiles('Cargo.lock') }}-v1 key: rust-${{ matrix.target }}-${{ matrix.rust_toolchain }}-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.rust_toolchain }}-cargo-registry-directory-${{ hashFiles('Cargo.lock') }}-v1 key: rust-${{ matrix.target }}-${{ matrix.rust_toolchain }}-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
@ -89,6 +100,17 @@ jobs:
run: cargo check --workspace --all-targets --all-features run: cargo check --workspace --all-targets --all-features
- name: Cargo test - name: Cargo test
if: (!matrix.skip_tests)
run: cargo test --workspace --all-features run: cargo test --workspace --all-features
env: env:
MONERO_ADDITIONAL_SLEEP_PERIOD: 60000 MONERO_ADDITIONAL_SLEEP_PERIOD: 60000
- name: Build binary
run: |
cargo build -p swap --target ${{ matrix.target }}
- name: Upload binary
uses: actions/upload-artifact@v2-preview
with:
name: swap-${{ matrix.target }}
path: target/${{ matrix.target }}/debug/swap