Skip to content

ci(deps): bump the github-actions group across 1 directory with 3 updates #219

ci(deps): bump the github-actions group across 1 directory with 3 updates

ci(deps): bump the github-actions group across 1 directory with 3 updates #219

Workflow file for this run

name: CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: rustferry-ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
jobs:
quality:
name: Linux quality and docs
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: stable
components: clippy, rustfmt
- name: Install Linux UI prerequisites
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends libfontconfig1-dev
- uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 # v2
with:
cache-bin: "false"
- name: License policy
run: python3 scripts/check-licenses.py
- name: Release contract
run: python3 scripts/check-release-contract.py
- name: Release archive guard tests
run: python3 -B -m unittest discover -s scripts/tests -p 'test_*.py'
- name: Formatting
run: cargo fmt --all -- --check
- name: Clippy
run: cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
- name: Packaged CLI sources
shell: bash
run: |
set -euo pipefail
package_files="$RUNNER_TEMP/cargo-ferry-package-files.txt"
cargo package -p cargo-ferry --list > "$package_files"
test "$(grep -c '^embedded-docs/' "$package_files")" -eq 16
isolated="$RUNNER_TEMP/cargo-ferry-package-smoke"
mkdir -p "$isolated"
cp Cargo.toml Cargo.lock "$isolated/"
cp -R crates "$isolated/"
CARGO_TARGET_DIR="$RUNNER_TEMP/cargo-ferry-package-target" \
cargo check --locked --manifest-path "$isolated/Cargo.toml" -p cargo-ferry
embedded_result="$RUNNER_TEMP/cargo-ferry-embedded-docs.json"
CARGO_TARGET_DIR="$RUNNER_TEMP/cargo-ferry-package-target" \
cargo run --locked --quiet --manifest-path "$isolated/Cargo.toml" \
-p cargo-ferry -- --json docs remote-push > "$embedded_result"
jq -e '
.status == "ok" and
.data.source == "embedded" and
(.data.content | startswith("# Remote push"))
' "$embedded_result" > /dev/null
- name: Workspace package archives
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target
run: |
cmp schemas/ferry.schema.json crates/rustferry-core/tests/fixtures/ferry.schema.json
cmp schemas/ide-protocol-v1.schema.json crates/cargo-ferry/tests/fixtures/ide-protocol-v1/schema.json
cargo package --workspace --exclude rustferry-worker-macos --locked
test "$(find target/package -maxdepth 1 -name '*.crate' | wc -l | tr -d ' ')" -eq 9
python3 scripts/check-release-archives.py --check-sources target/package/*.crate
- name: Standalone example checks and tests
shell: bash
env:
CARGO_TARGET_DIR: ${{ runner.temp }}/cargo-ferry-examples
run: |
set -euo pipefail
for manifest in examples/*/Cargo.toml; do
cargo check --locked --manifest-path "$manifest" --all-targets
cargo test --locked --manifest-path "$manifest" --test basic
done
- name: Rustdoc and doctests
env:
RUSTDOCFLAGS: -D warnings
run: |
cargo doc --locked --workspace --all-features --no-deps
cargo test --locked --workspace --all-features --doc
- name: Cookbook snippets
shell: bash
run: |
set -euo pipefail
messages="$RUNNER_TEMP/runtime-build.jsonl"
cargo build --locked -p rustferry --message-format=json > "$messages"
rustferry_rlib="$(jq -r '
select(.reason == "compiler-artifact" and .target.name == "rustferry")
| .filenames[] | select(endswith(".rlib"))
' "$messages" | tail -n 1)"
serde_rlib="$(jq -r '
select(.reason == "compiler-artifact" and .target.name == "serde")
| .filenames[] | select(endswith(".rlib"))
' "$messages" | tail -n 1)"
test -n "$rustferry_rlib"
test -n "$serde_rlib"
for page in docs/cookbook/*.md; do
rustdoc --test "$page" --edition 2024 \
-L dependency=target/debug/deps \
--extern "rustferry=$rustferry_rlib" \
--extern "serde=$serde_rlib"
done
- name: Local documentation links
shell: bash
run: |
python3 - <<'PY'
from pathlib import Path
from urllib.parse import unquote, urlparse
import re
root = Path.cwd()
documents = [root / name for name in ("README.md", "CONTRIBUTING.md", "SECURITY.md")]
documents.extend((root / "docs").rglob("*.md"))
documents.extend((root / "examples").glob("*/README.md"))
failures = []
link_pattern = re.compile(r"!?\[[^\]]*\]\(([^)]+)\)")
for document in documents:
for match in link_pattern.finditer(document.read_text(encoding="utf-8")):
raw_target = match.group(1).strip().strip("<>")
target = raw_target.split("#", 1)[0].split("?", 1)[0]
if not target or urlparse(target).scheme or target.startswith("//"):
continue
destination = (document.parent / unquote(target)).resolve()
if not destination.exists():
line = document.read_text(encoding="utf-8").count("\n", 0, match.start()) + 1
failures.append(f"{document.relative_to(root)}:{line}: {raw_target}")
if failures:
raise SystemExit("Broken local Markdown links:\n" + "\n".join(failures))
PY
- uses: taiki-e/install-action@37f7c5781271959fb65b6b35224e28652ff2b63d # v2
with:
tool: mdbook@0.5.4
fallback: none
- name: mdBook
run: mdbook build docs
msrv:
name: Rust 1.92 minimum version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: 1.92.0
- name: Workspace check
run: cargo check --locked --workspace --all-targets --all-features
portability:
name: Tests and templates (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable
with:
toolchain: stable
- name: Install Linux UI prerequisites
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends libfontconfig1-dev
- uses: Swatinem/rust-cache@f0d9c3887740aee45f6153b24b3a6b815192ec16 # v2
with:
cache-bin: "false"
- name: Workspace tests (Linux)
if: runner.os == 'Linux'
timeout-minutes: 20
run: cargo test --locked --workspace --all-features -- --test-threads=1
- name: Workspace tests (macOS and Windows)
if: runner.os != 'Linux'
timeout-minutes: 45
run: cargo test --locked --workspace --all-features
- name: Generate and check starter (Unix)
if: runner.os != 'Windows'
shell: bash
env:
CARGO_FERRY_RUNTIME_PATH: ${{ github.workspace }}/crates/rustferry
run: |
set -euo pipefail
cargo run -p cargo-ferry -- new ci-starter --parent "$RUNNER_TEMP" --no-git --no-check
cargo check --manifest-path "$RUNNER_TEMP/ci-starter/Cargo.toml"
cargo test --manifest-path "$RUNNER_TEMP/ci-starter/Cargo.toml"
cargo run -p cargo-ferry -- add notifications --project-dir "$RUNNER_TEMP/ci-starter"
cargo check --manifest-path "$RUNNER_TEMP/ci-starter/Cargo.toml"
cargo run -p cargo-ferry -- add widget --project-dir "$RUNNER_TEMP/ci-starter"
cargo check --manifest-path "$RUNNER_TEMP/ci-starter/Cargo.toml"
- name: Generate and check starter (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
CARGO_FERRY_RUNTIME_PATH: ${{ github.workspace }}/crates/rustferry
run: |
$ErrorActionPreference = 'Stop'
cargo run -p cargo-ferry -- new ci-starter --parent $env:RUNNER_TEMP --no-git --no-check
cargo check --manifest-path (Join-Path $env:RUNNER_TEMP 'ci-starter/Cargo.toml')
cargo test --manifest-path (Join-Path $env:RUNNER_TEMP 'ci-starter/Cargo.toml')
cargo run -p cargo-ferry -- add notifications --project-dir (Join-Path $env:RUNNER_TEMP 'ci-starter')
cargo check --manifest-path (Join-Path $env:RUNNER_TEMP 'ci-starter/Cargo.toml')
cargo run -p cargo-ferry -- add widget --project-dir (Join-Path $env:RUNNER_TEMP 'ci-starter')
cargo check --manifest-path (Join-Path $env:RUNNER_TEMP 'ci-starter/Cargo.toml')