#[allow(missing_docs)] を #[expect(missing_docs)] に置き換える #1066
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: | |
| paths-ignore: | |
| - "**.md" | |
| schedule: | |
| # JST 11:00 (UTC 02:00), 月-金 | |
| - cron: "0 2 * * 1-5" | |
| jobs: | |
| ci: | |
| name: CI | |
| strategy: | |
| matrix: | |
| os: | |
| - ubuntu-24.04 | |
| - ubuntu-24.04-arm | |
| - windows-2025 | |
| - macos-26 | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Windows の場合には MSVC 系ではなく MinGW 系を使うようにする | |
| if: contains(matrix.os, 'windows') | |
| run: rustup set default-host x86_64-pc-windows-gnu | |
| - run: rustup update stable | |
| - uses: shiguredo/github-actions/.github/actions/rust-cache@main | |
| with: | |
| os: ${{ matrix.os }} | |
| toolchain: stable | |
| - run: cargo fmt --all --check | |
| - run: cargo check --workspace --exclude dump_wasm --exclude transcode_wasm --exclude fuzz | |
| - run: cargo build --workspace --exclude dump_wasm --exclude transcode_wasm --exclude fuzz | |
| - run: cargo test --workspace --exclude dump_wasm --exclude transcode_wasm --exclude fuzz | |
| - run: cargo clippy --workspace --exclude dump_wasm --exclude transcode_wasm --exclude fuzz -- -D warnings | |
| - run: cargo doc --workspace --exclude dump_wasm --exclude transcode_wasm --exclude fuzz | |
| env: | |
| RUSTDOCFLAGS: "-D warnings" | |
| - name: Windows の場合には MSVC 系でもビルドだけは試す | |
| if: contains(matrix.os, 'windows') | |
| run: | | |
| rustup target add x86_64-pc-windows-msvc | |
| cargo build --package c-api --target x86_64-pc-windows-msvc | |
| - name: MSVC ビルド成果物の確認 | |
| if: contains(matrix.os, 'windows') | |
| run: ls target/x86_64-pc-windows-msvc/debug/mp4.lib | |
| test-wasm: | |
| name: Test WebAssembly | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - run: rustup update stable | |
| - run: rustup target add wasm32-unknown-unknown | |
| - uses: shiguredo/github-actions/.github/actions/rust-cache@main | |
| with: | |
| os: ubuntu-24.04 | |
| toolchain: stable | |
| - name: Install Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 | |
| with: | |
| node-version: "24" | |
| - name: Build WebAssembly | |
| run: cargo build -p wasm --target wasm32-unknown-unknown --profile release-wasm | |
| - name: Run mux.js test | |
| run: | | |
| node crates/wasm/examples/mux.js /tmp/test_output.mp4 | |
| if [ ! -f /tmp/test_output.mp4 ]; then | |
| echo "Error: mux.js did not create output file" | |
| exit 1 | |
| fi | |
| echo "mux.js completed successfully" | |
| - name: Run demux.js test | |
| run: | | |
| node crates/wasm/examples/demux.js /tmp/test_output.mp4 | |
| echo "demux.js completed successfully" | |
| build-c-api: | |
| name: Build C API Library | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| artifact-name: ubuntu-24.04_x86_64 | |
| - os: ubuntu-24.04-arm | |
| artifact-name: ubuntu-24.04_arm64 | |
| - os: windows-2025 | |
| artifact-name: windows-2025_x86_64 | |
| - os: macos-26 | |
| artifact-name: macos-26_arm64 | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - run: rustup update stable | |
| - uses: shiguredo/github-actions/.github/actions/rust-cache@main | |
| with: | |
| os: ${{ matrix.os }} | |
| toolchain: stable | |
| - name: Build C API | |
| run: cargo build --release --package c-api | |
| - name: Prepare artifacts (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| mkdir -p artifacts/lib artifacts/include | |
| cp $(ls target/release/libmp4.* | grep -E '\.(a|so|dylib)$') artifacts/lib/ | |
| cp crates/c-api/include/mp4.h artifacts/include/ | |
| - name: Prepare artifacts (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Path "artifacts/lib" -Force | |
| New-Item -ItemType Directory -Path "artifacts/include" -Force | |
| Copy-Item -Path "target/release/mp4.dll" -Destination "artifacts/lib/" | |
| Copy-Item -Path "target/release/mp4.lib" -Destination "artifacts/lib/" | |
| Copy-Item -Path "crates/c-api/include/mp4.h" -Destination "artifacts/include/" | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: c-api-${{ matrix.artifact-name }} | |
| path: artifacts/ | |
| build-wasm: | |
| name: Build WebAssembly | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - run: rustup update stable | |
| - run: rustup target add wasm32-unknown-unknown | |
| - uses: shiguredo/github-actions/.github/actions/rust-cache@main | |
| with: | |
| os: ubuntu-24.04 | |
| toolchain: stable | |
| - name: Install wasm-opt | |
| run: | | |
| curl -L -o binaryen.tar.gz https://github.com/WebAssembly/binaryen/releases/download/version_125/binaryen-version_125-x86_64-linux.tar.gz | |
| echo "7c3bc16599c8274a04d34a504fe4be2047884f900e0e2da2f6fb9cd667183be4 binaryen.tar.gz" | sha256sum -c - | |
| tar xzf binaryen.tar.gz | |
| sudo mv binaryen-version_125/bin/wasm-opt /usr/local/bin/ | |
| - name: Build WebAssembly | |
| run: cargo build --profile release-wasm --package wasm --target wasm32-unknown-unknown | |
| - name: Optimize with wasm-opt | |
| run: | | |
| wasm-opt -Oz --enable-bulk-memory -o target/wasm32-unknown-unknown/release-wasm/mp4_wasm-opt.wasm target/wasm32-unknown-unknown/release-wasm/mp4_wasm.wasm | |
| mv target/wasm32-unknown-unknown/release-wasm/mp4_wasm-opt.wasm target/wasm32-unknown-unknown/release-wasm/mp4_wasm.wasm | |
| - name: Prepare artifacts | |
| run: | | |
| mkdir -p artifacts | |
| cp target/wasm32-unknown-unknown/release-wasm/mp4_wasm.wasm artifacts/ | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: wasm | |
| path: artifacts/ | |
| slack_notify: | |
| needs: [ci, test-wasm, build-c-api, build-wasm] | |
| runs-on: ubuntu-slim | |
| if: ${{ always() }} | |
| permissions: | |
| actions: read | |
| steps: | |
| - name: Slack Notification | |
| uses: shiguredo/github-actions/.github/actions/slack-notify@main | |
| with: | |
| status: ${{ job.status }} | |
| slack_webhook: ${{ secrets.SLACK_WEBHOOK }} | |
| slack_channel: rust-oss | |
| notify_mode: failure_and_fixed |