Skip to content

ci: test rust workflow #31

ci: test rust workflow

ci: test rust workflow #31

Workflow file for this run

name: Rust
on:
push:
branches: [ "main" ]
paths-ignore:
- "*.md"
- "LICENSE"
pull_request:
branches: [ "main" ]
paths-ignore:
- "*.md"
- "LICENSE"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- aarch64-linux-android # 64-bit ARM
- armv7-linux-androideabi # 32-bit ARM
- i686-linux-android # 32-bit x86
- x86_64-linux-android # 64-bit x86
- arm-linux-androideabi # 32-bit ARM (older ABI)
- thumbv7neon-linux-androideabi # 32-bit ARM with NEON
name: ${{ matrix.target }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Deps & Bins
uses: Swatinem/rust-cache@v2
- name: Install cross
shell: bash
run: |
if ! command -v cross &> /dev/null; then
echo "cross not found, installing..."
cargo install cross --git https://github.com/cross-rs/cross
else
echo "cross already installed, skipping installation."
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-docker-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-
- name: Build - ${{ matrix.target }}
shell: bash
run: cross build --target=${{ matrix.target }} --verbose
- name: Test - ${{ matrix.target }}
shell: bash
run: cross test --target=${{ matrix.target }} --verbose