Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup ARM Build Environment
description: Setup an ARM build environment
name: Setup target Build Environment
description: Setup an ARM or x86_64 build environment

inputs:
arch:
Expand All @@ -16,6 +16,7 @@ runs:
using: composite
steps:
- name: Replace target string
if: inputs.arch != 'x86_64'
uses: mad9000/actions-find-and-replace-string@3
id: findandreplace
with:
Expand All @@ -33,11 +34,13 @@ runs:
- uses: Swatinem/rust-cache@v2

- name: Install Cross-Compile Support
if: inputs.arch != 'x86_64'
uses: cyberjunk/gha-ubuntu-cross@v3
with:
arch: ${{ inputs.arch }}

- name: Install dependencies
- name: Install dependencies (Raspberry Pi)
if: inputs.arch != 'x86_64'
shell: bash
run: |
sudo apt install -y \
Expand All @@ -53,7 +56,13 @@ runs:
musl-tools \
pkg-config

- name: Install dependencies (x86_64 linux)
if: inputs.target == 'x86_64-unknown-linux-gnu' || inputs.target == 'x86_64-unknown-linux-musl'
shell: bash
run: sudo apt-get install musl-tools libudev-dev

- name: Set environment variables
if: inputs.arch != 'x86_64'
shell: bash
run: |
echo "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0" >> $GITHUB_ENV
Expand Down
130 changes: 93 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,99 +23,155 @@ jobs:
# Check

check:
name: Check
name: Check (${{ matrix.platform.target }})
strategy:
fail-fast: false
matrix:
platform:
- os: "macos-12"
target: "x86_64-apple-darwin"
arch: "x86_64"
- os: "ubuntu-22.04"
target: "x86_64-unknown-linux-gnu"
arch: "x86_64"
- os: "ubuntu-22.04"
target: "x86_64-unknown-linux-musl"
arch: "x86_64"
- os: "windows-2022"
target: "x86_64-pc-windows-msvc"
arch: "x86_64"
- os: "ubuntu-22.04"
target: "aarch64-unknown-linux-gnu"
arch: "arm64"
features: "--features=raspberry"
- os: "ubuntu-22.04"
target: "armv7-unknown-linux-gnueabihf"
arch: "armhf"
features: "--features=raspberry"
runs-on: ${{ matrix.platform.os }}

steps:
- name: Install dependencies
if: matrix.platform.os == 'ubuntu-22.04'
run: sudo apt-get install musl-tools libudev-dev

- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable

- uses: ./.github/actions/setup-target
with:
targets: ${{ matrix.platform.target }}
- uses: Swatinem/rust-cache@v2
arch: ${{ matrix.platform.arch }}
target: ${{ matrix.platform.target }}

- run: cargo check ${{ matrix.platform.features }}

- run: cargo check

check-lib:
name: Check (lib)
name: Check lib (${{ matrix.platform.target }})
strategy:
fail-fast: false
matrix:
platform:
- target: "x86_64-unknown-linux-gnu"
arch: "x86_64"
- target: "aarch64-unknown-linux-gnu"
arch: "arm64"
features: "--features=raspberry"
- target: "armv7-unknown-linux-gnueabihf"
arch: "armhf"
features: "--features=raspberry"
runs-on: ubuntu-22.04

steps:
- name: Install dependencies
run: sudo apt-get install musl-tools libudev-dev

- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- run: cargo check --lib --no-default-features
- uses: ./.github/actions/setup-target
with:
arch: ${{ matrix.platform.arch }}
target: ${{ matrix.platform.target }}

- run: cargo check --lib --no-default-features ${{ matrix.platform.features }}

msrv:
name: Check MSRV
name: Check MSRV (${{ matrix.platform.target }})
strategy:
fail-fast: false
matrix:
platform:
- target: "x86_64-unknown-linux-gnu"
arch: "x86_64"
- target: "aarch64-unknown-linux-gnu"
arch: "arm64"
features: "--features=raspberry"
- target: "armv7-unknown-linux-gnueabihf"
arch: "armhf"
features: "--features=raspberry"
runs-on: ubuntu-22.04

steps:
- name: Install dependencies
run: sudo apt-get install musl-tools libudev-dev

- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@v1

- uses: ./.github/actions/setup-target
with:
arch: ${{ matrix.platform.arch }}
target: ${{ matrix.platform.target }}
toolchain: "1.65"
- uses: Swatinem/rust-cache@v2

- run: cargo check
- run: cargo check ${{ matrix.platform.features }}

# --------------------------------------------------------------------------
# Test

test:
name: Unit Tests
name: Unit Tests (${{ matrix.platform.target }})
strategy:
fail-fast: false
matrix:
platform:
- target: "x86_64-unknown-linux-gnu"
arch: "x86_64"
- target: "aarch64-unknown-linux-gnu"
arch: "arm64"
features: "--features=raspberry"
- target: "armv7-unknown-linux-gnueabihf"
arch: "armhf"
features: "--features=raspberry"
runs-on: ubuntu-22.04

steps:
- name: Install dependencies
run: sudo apt-get install musl-tools libudev-dev

- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- run: cargo test --lib
- uses: ./.github/actions/setup-target
with:
arch: ${{ matrix.platform.arch }}
target: ${{ matrix.platform.target }}

- run: cargo test --lib ${{ matrix.platform.features }}

# --------------------------------------------------------------------------
# Lint

clippy:
name: Clippy
name: Clippy (${{ matrix.platform.target }})
strategy:
fail-fast: false
matrix:
platform:
- target: "x86_64-unknown-linux-gnu"
arch: "x86_64"
- target: "aarch64-unknown-linux-gnu"
arch: "arm64"
features: "--features=raspberry"
- target: "armv7-unknown-linux-gnueabihf"
arch: "armhf"
features: "--features=raspberry"
runs-on: ubuntu-22.04

steps:
- name: Install dependencies
run: sudo apt-get install musl-tools libudev-dev

- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable

- uses: ./.github/actions/setup-target
with:
arch: ${{ matrix.platform.arch }}
target: ${{ matrix.platform.target }}
components: clippy
- uses: Swatinem/rust-cache@v2

- run: cargo clippy -- -D warnings -A clippy::too_many_arguments
- run: cargo clippy ${{ matrix.platform.features }} -- -D warnings -A clippy::too_many_arguments

rustfmt:
name: Rustfmt
Expand Down
141 changes: 0 additions & 141 deletions .github/workflows/raspberry_ci.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.