Skip to content

chore(deps): update actions/checkout digest to 1d96c77 #1725

chore(deps): update actions/checkout digest to 1d96c77

chore(deps): update actions/checkout digest to 1d96c77 #1725

Workflow file for this run

name: CI
on:
push:
branches-ignore:
- gh-pages
pull_request:
types:
- opened
- synchronize
branches-ignore:
- gh-pages
release:
types:
- published
env:
MSRV: '1.73.0'
jobs:
msrv_check:
name: MSRV check
runs-on: ubuntu-22.04
# Exclude in-repo PRs from running this job
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
steps:
- name: πŸ“₯ Checkout source
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4
- name: 🧰 Install MSRV toolchain
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 # v1
with:
toolchain: ${{ env.MSRV }}
- name: πŸ’¨ Cache Rust artifacts
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: βš™οΈ Run tests
run: cargo test -p optivorbis -p optivorbis_cli -p vorbis_bitpack
ci:
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- x86_64-pc-windows-gnu
- x86_64-apple-darwin
- aarch64-apple-darwin
include:
- target: x86_64-unknown-linux-musl
runner: ubuntu-22.04
- target: aarch64-unknown-linux-musl
runner: ubuntu-22.04
- target: x86_64-pc-windows-gnu
runner: windows-2022
- target: x86_64-apple-darwin
runner: macos-12
- target: aarch64-apple-darwin
runner: macos-14
name: CI (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
# Exclude in-repo PRs from running this job
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
steps:
- name: πŸ“₯ Checkout source
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4
with:
fetch-depth: 0 # Keep the commit history for proper version information
- name: 🧰 Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
target: ${{ matrix.target }}
components: rust-src, rustfmt, clippy
- name: 🧰 Install ARM64 cross-compilation toolchain
if: startsWith(matrix.target, 'aarch64-unknown-linux')
run: |
sudo apt update
sudo apt install -yq gcc-aarch64-linux-gnu libc6-arm64-cross qemu-user
- name: πŸ’¨ Cache Rust artifacts
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: πŸ“… Gather build date and version metadata
shell: bash
run: |
echo "OPTIVORBIS_VERSION=$(git describe --tags --dirty=-custom --always)" >> "$GITHUB_ENV"
echo "OPTIVORBIS_BUILD_DATE=$(date -u +%Y-%m-%d)" >> "$GITHUB_ENV"
- name: 'πŸ” Static analysis: run Clippy'
uses: giraffate/clippy-action@13b9d32482f25d29ead141b79e7e04e7900281e0 # v1
if: matrix.target == 'x86_64-unknown-linux-musl' && github.event_name != 'release'
with:
clippy_flags: --no-deps --all-targets --all-features -- -D warnings
reporter: github-check
fail_on_error: true
- name: 'πŸ” Static analysis: run rustfmt'
if: matrix.target == 'x86_64-unknown-linux-musl'
run: cargo fmt --check --all
- name: 'πŸ” Static analysis: run cargo deny'
if: matrix.target == 'x86_64-unknown-linux-musl'
uses: EmbarkStudios/cargo-deny-action@b01e7a8cfb1f496c52d77361e84c1840d8246393 # v1
- name: βœ”οΈ Run tests
run: cargo test --release --target ${{ matrix.target }} -Zdoctest-xcompile
-p optivorbis -p optivorbis_cli -p vorbis_bitpack
- name: πŸ“š Build documentation
if: matrix.target == 'x86_64-unknown-linux-musl'
run: cargo doc
- name: πŸ”¨ Build CLI executable
run: cargo build --target ${{ matrix.target }} --release
-Z build-std=panic_abort,core,std,alloc,proc_macro
-Z build-std-features=panic_immediate_abort
- name: πŸ“€ Upload CLI executable artifact
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # v4
with:
name: OptiVorbis CLI (${{ matrix.target }})
path: |
target/${{ matrix.target }}/release/optivorbis*
!target/${{ matrix.target }}/release/optivorbis.d
web_demo:
name: Web demo
needs: ci
runs-on: ubuntu-22.04
# Exclude in-repo PRs from running this job
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
defaults:
run:
working-directory: web
steps:
- name: πŸ“₯ Checkout source
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4
with:
fetch-depth: 0 # Keep the commit history for proper version information
- name: 🧰 Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
- name: 🧰 Setup Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: 20
- name: 🧰 Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: πŸ’¨ Cache Rust artifacts
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2
- name: πŸ“… Gather build date and version metadata
shell: bash
run: |
echo "OPTIVORBIS_VERSION=$(git describe --tags --dirty=-custom --always)" >> "$GITHUB_ENV"
echo "OPTIVORBIS_BUILD_DATE=$(date -u +%Y-%m-%d)" >> "$GITHUB_ENV"
- name: πŸ”¨ Build web demo
run: npm ci
- name: 'πŸ” Static analysis: ESLint'
run: npm run lint
- name: πŸ“€ Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4
if: github.ref == 'refs/heads/master' # Only run for pushes to the master branch
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/web