Skip to content

Commit

Permalink
Use CI matrix for more refined results
Browse files Browse the repository at this point in the history
  • Loading branch information
joaofl committed Aug 22, 2024
1 parent 3c41cc6 commit f28a162
Showing 1 changed file with 41 additions and 15 deletions.
56 changes: 41 additions & 15 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,24 @@ on:

env:
CARGO_TERM_COLOR: always
TARGETS: "x86_64-pc-windows-gnu x86_64-unknown-linux-gnu armv7-unknown-linux-gnueabihf aarch64-unknown-linux-gnu"

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
target:
- "x86_64-unknown-linux-gnu"
- "x86_64-pc-windows-gnu"
- "aarch64-unknown-linux-gnu"
- "armv7-unknown-linux-gnueabihf"
- "arm-unknown-linux-gnueabihf"

steps:
- name: Checkout
uses: actions/checkout@v3

##################################
# - name: Cache Rust dependencies
# uses: actions/cache@v2
# with:
# path: |
# ~/.cargo/registry
# ~/.cargo/git
# target

###################################
- name: Setup for Linux x86_64
uses: actions-rs/toolchain@v1
with:
Expand All @@ -39,9 +36,38 @@ jobs:

- name: Install extra packages
run: |
sudo apt-get update && sudo apt-get install -y libatk1.0-dev libcairo2-dev libpango1.0-dev libgdk-pixbuf2.0-dev libgtk-3-dev python3-pip tftp
cargo install cross --git https://github.com/cross-rs/cross
- name: Build all targets
- name: Build target ${{ matrix.target }}
continue-on-error: false
run: cross build --target ${{ matrix.target }}


- name: Test target x86_64-unknown-linux-gnu
continue-on-error: false
run: ./cross-build-all.sh
run: cross test --target x86_64-unknown-linux-gnu


# test:
# needs: build
# runs-on: ubuntu-latest

# steps:
# - name: Checkout
# uses: actions/checkout@v3

# - name: Setup for Linux x86_64
# uses: actions-rs/toolchain@v1
# with:
# profile: minimal
# toolchain: stable

# - name: Install extra packages
# run: |
# cargo install cross --git https://github.com/cross-rs/cross

# - name: Test on target
# continue-on-error: false
# run: |
# cross build --release
# cross test --release

0 comments on commit f28a162

Please sign in to comment.