Windowsでのテスト, CIが通るよう修正 #18
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: Linux Test | ||
on: | ||
push: | ||
branches: [ master, main ] | ||
pull_request: | ||
branches: [ master, main ] | ||
jobs: | ||
# ──────────────── | ||
# 1. x86_64 / i686 用 | ||
# ──────────────── | ||
cross: | ||
name: Test on Linux (x86_64 & i686) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- target_arch: x86_64-unknown-linux-gnu | ||
needs_multilib: false | ||
- target_arch: i686-unknown-linux-gnu | ||
needs_multilib: true | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install build tools and cross-compilers | ||
run: | | ||
sudo apt-get update -qq | ||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
build-essential cmake git wget clang pkg-config | ||
if [ "${{ matrix.needs_multilib }}" = "true" ]; then | ||
sudo apt-get install -y gcc-multilib g++-multilib | ||
fi | ||
shell: bash | ||
- name: Install target libraries and configure pkg-config | ||
run: | | ||
TARGET="${{ matrix.target_arch }}" | ||
if [ "$TARGET" = "x86_64-unknown-linux-gnu" ]; then | ||
sudo apt-get install -y libpcsclite-dev libdvbv5-dev libudev-dev | ||
else | ||
sudo dpkg --add-architecture i386 | ||
sudo apt-get update -qq | ||
sudo apt-get install -y \ | ||
libpcsclite-dev:i386 libdvbv5-dev:i386 libudev-dev:i386 | ||
# Configure pkg-config for cross-compilation | ||
echo "PKG_CONFIG_SYSROOT_DIR=/" >> $GITHUB_ENV | ||
echo "PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig" >> $GITHUB_ENV | ||
echo "PKG_CONFIG_PATH=" >> $GITHUB_ENV | ||
fi | ||
shell: bash | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
target: ${{ matrix.target_arch }} | ||
override: true | ||
default: true | ||
- name: Cargo Check & Test | ||
run: | | ||
cargo check -F dvb --target ${{ matrix.target_arch }} | ||
cargo test -F dvb --target ${{ matrix.target_arch }} | ||
# ───────────────────────── | ||
# 2. aarch64 ネイティブ(Docker) | ||
# ───────────────────────── | ||
aarch64: | ||
name: Test on Linux (aarch64 in container) | ||
runs-on: ubuntu-latest | ||
# Linux/ARM64 プラットフォームの Docker コンテナ上で実行 | ||
container: | ||
image: ubuntu:22.04 | ||
platform: linux/arm64 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
# QEMU の設定は不要(完全に ARM64 環境のコンテナ内なので) | ||
- name: Install build tools and libraries | ||
run: | | ||
apt-get update -qq | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
build-essential cmake git wget clang pkg-config \ | ||
libpcsclite-dev libdvbv5-dev libudev-dev gcc-aarch64-linux-gnu | ||
shell: bash | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
target: aarch64-unknown-linux-gnu | ||
override: true | ||
default: true | ||
- name: Cargo Check & Test | ||
run: | | ||
cargo check -F dvb --target aarch64-unknown-linux-gnu | ||
cargo test -F dvb --target aarch64-unknown-linux-gnu |