Browse Source

Split cargo CI job into x64 and arm

There is so much conditional logic on compiling for x64 and armv7
that we are better off with just defining two separate jobs without
any conditional logic.
fix-olivia-event-id
Thomas Eizinger 4 years ago
parent
commit
9e0504b409
No known key found for this signature in database GPG Key ID: 651AC83A6C6C8B96
  1. 49
      .github/workflows/ci.yml

49
.github/workflows/ci.yml

@ -64,34 +64,21 @@ jobs:
test_daemons: test_daemons:
strategy: strategy:
matrix: matrix:
target: [ x86_64-unknown-linux-gnu, x86_64-apple-darwin ] os: [ ubuntu-latest, macos-latest ]
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: armv7-unknown-linux-gnueabihf
os: ubuntu-latest
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Setup rust toolchain - name: Setup rust toolchain
run: rustup show run: rustup show
- uses: Swatinem/rust-cache@v1.3.0 - uses: Swatinem/rust-cache@v1.3.0
- name: Install compiler for armhf arch - run: cargo build --bins --tests
if: matrix.target == 'armv7-unknown-linux-gnueabihf'
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
- run: cargo build --target ${{ matrix.target }}
- run: cargo test --workspace - run: cargo test --workspace
- name: Smoke test ${{ matrix.target }} binary - name: Smoke test ${{ matrix.os }} binary
if: matrix.target != 'armv7-unknown-linux-gnueabihf'
run: | run: |
target/${{ matrix.target }}/debug/maker --data-dir=/tmp/maker --generate-seed & target/debug/maker --data-dir=/tmp/maker --generate-seed &
sleep 5s # Wait for maker to start sleep 5s # Wait for maker to start
target/${{ matrix.target }}/debug/taker --data-dir=/tmp/taker --generate-seed & target/debug/taker --data-dir=/tmp/taker --generate-seed &
sleep 5s # Wait for taker to start sleep 5s # Wait for taker to start
curl --fail http://localhost:8000/api/alive curl --fail http://localhost:8000/api/alive
@ -99,7 +86,27 @@ jobs:
- name: Upload binaries - name: Upload binaries
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
with: with:
name: maker-and-taker-binaries-${{ matrix.target }} name: maker-and-taker-binaries-${{ matrix.os }}
path: |
target/debug/maker
target/debug/taker
daemons_arm_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup rust toolchain
run: rustup show
- uses: Swatinem/rust-cache@v1.3.0
- name: Install compiler for armhf arch
run: |
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf
- run: cargo build --target=armv7-unknown-linux-gnueabihf --bins
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: maker-and-taker-binaries-armv7
path: | path: |
target/${{ matrix.target }}/debug/maker target/armv7-unknown-linux-gnueabihf/debug/maker
target/${{ matrix.target }}/debug/taker target/armv7-unknown-linux-gnueabihf/debug/taker

Loading…
Cancel
Save