linux build specifics #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| arch: x86_64 | |
| - os: ubuntu-latest | |
| arch: aarch64 | |
| - os: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Set up QEMU (for aarch64 on Linux) | |
| if: matrix.arch == 'aarch64' && runner.os == 'Linux' | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-${{ matrix.arch || 'x86_64' }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install system dependencies (Ubuntu) | |
| if: runner.os == 'Linux' && matrix.arch != 'aarch64' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libx11-dev libxdo-dev libxcb-shape0-dev libxcb-xfixes0-dev libxtst-dev | |
| - name: Build and test (Linux aarch64) | |
| if: matrix.arch == 'aarch64' && runner.os == 'Linux' | |
| uses: uraimo/run-on-arch-action@v2 | |
| with: | |
| arch: aarch64 | |
| distro: ubuntu22.04 | |
| install: | | |
| apt-get update | |
| apt-get install -y curl build-essential libx11-dev libxdo-dev libxcb-shape0-dev libxcb-xfixes0-dev libxtst-dev | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
| run: | | |
| . $HOME/.cargo/env | |
| cargo build --workspace --exclude g3-computer-control | |
| cargo test --workspace --exclude g3-computer-control --lib --tests | |
| - name: Build (Linux x86_64) | |
| if: matrix.arch != 'aarch64' && runner.os == 'Linux' | |
| run: cargo build --workspace --exclude g3-computer-control | |
| - name: Run tests (Linux x86_64) | |
| if: matrix.arch != 'aarch64' && runner.os == 'Linux' | |
| run: cargo test --workspace --exclude g3-computer-control --lib --tests | |
| - name: Build (macOS) | |
| if: runner.os == 'macOS' | |
| run: cargo build --workspace | |
| - name: Run tests (macOS) | |
| if: runner.os == 'macOS' | |
| run: cargo test --workspace --lib --tests |