Skip to content

refactor: simplify render_page function by introducing PageRenderStat… #43

refactor: simplify render_page function by introducing PageRenderStat…

refactor: simplify render_page function by introducing PageRenderStat… #43

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
jobs:
checks:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Format
run: cargo fmt --all --check
- name: Lint
run: cargo clippy --all-targets --all-features --locked -- -D warnings
- name: Test
run: cargo test --workspace
- name: Doc tests
run: cargo test --doc --workspace
build-targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Generate build target matrix
id: matrix
run: python3 ./scripts/github-actions/generate_build_matrix.py
build-artifacts:
name: Build ${{ matrix.feature.label }} on ${{ matrix.target.target }}
needs: [checks, build-targets]
runs-on: ${{ matrix.target.runner }}
env:
BUILD_PROFILE: min-size
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.build-targets.outputs.matrix).include }}
feature:
# - label: lua
# flags: lua
# - label: wasi
# flags: wasi
- label: full
flags: full
steps:
- uses: actions/checkout@v6
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install cross
if: ${{ matrix.target.builder == 'cross' }}
uses: taiki-e/install-action@v2
with:
tool: cross
- name: Add Rust target
run: rustup target add ${{ matrix.target.target }}
- name: Read workspace version
id: version
run: python3 ./scripts/github-actions/read_workspace_version.py
- name: Build minimal binary
shell: bash
env:
BUILD_TARGET: ${{ matrix.target.target }}
BUILD_TOOL: ${{ matrix.target.builder }}
FEATURE_FLAGS: ${{ matrix.feature.flags }}
run: bash ./scripts/github-actions/build_binary.sh
- name: Package Unix artifact
if: ${{ runner.os != 'Windows' }}
shell: bash
env:
BUILD_TARGET: ${{ matrix.target.target }}
VERSION: ${{ steps.version.outputs.version }}
TARGET_TRIPLE: ${{ matrix.target.target }}
ARTIFACT_VARIANT: ${{ matrix.feature.label }}
run: bash ./scripts/github-actions/package_unix.sh
- name: Package Windows artifact
if: ${{ runner.os == 'Windows' }}
shell: pwsh
env:
BUILD_TARGET: ${{ matrix.target.target }}
VERSION: ${{ steps.version.outputs.version }}
TARGET_TRIPLE: ${{ matrix.target.target }}
ARTIFACT_VARIANT: ${{ matrix.feature.label }}
STAGING_DIR_NAME: vs-package-${{ matrix.target.target }}-${{ matrix.feature.label }}
run: ./scripts/github-actions/package_windows.ps1
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: vs-v${{ steps.version.outputs.version }}-${{ matrix.target.target }}-${{ matrix.feature.label }}
path: ${{ env.ARCHIVE_PATH }}
if-no-files-found: error
retention-days: 14