Skip to content

chore(deps): Update taiki-e/install-action digest to 3d83223 #207

chore(deps): Update taiki-e/install-action digest to 3d83223

chore(deps): Update taiki-e/install-action digest to 3d83223 #207

Workflow file for this run

name: Host
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: "0"
CARGO_NET_RETRY: "10"
jobs:
host:
name: Host (clippy + test + smoke)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- name: Detect relevant changes
id: guard
shell: bash
run: |
set -euo pipefail
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
BASE="${{ github.event.pull_request.base.sha }}"
HEAD="${{ github.event.pull_request.head.sha }}"
else
BASE="${{ github.event.before }}"
HEAD="${{ github.sha }}"
fi
if [[ -z "$BASE" || "$BASE" == "0000000000000000000000000000000000000000" ]]; then
echo "run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
git fetch origin "$BASE" --depth=1 2>/dev/null || true
MERGE_BASE="$(git merge-base "$BASE" "$HEAD" 2>/dev/null || echo '')"
if [[ -z "$MERGE_BASE" ]]; then
echo "::warning::merge-base unavailable; defaulting to run."
echo "run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
CHANGED="$(git diff --name-only "$MERGE_BASE" "$HEAD" 2>/dev/null || echo '')"
if [[ -z "$CHANGED" ]]; then
echo "run=true" >> "$GITHUB_OUTPUT"
exit 0
fi
# Workspace crates + host-pty-server + root manifests + workflow config.
# Cargo.{toml,lock} is anchored to repo root; crate-level manifests are
# captured by their directory prefix.
PATTERNS='^(telepath-(wire|server|client|macros)/|examples/host-pty-server/|Cargo\.(toml|lock)$|Justfile$|rust-toolchain\.toml$|\.github/(workflows/host\.yml|actions/rust-setup/))'
if echo "$CHANGED" | grep -qE "$PATTERNS"; then
echo "run=true" >> "$GITHUB_OUTPUT"
else
echo "run=false" >> "$GITHUB_OUTPUT"
echo "::notice::No host-relevant changes; skipping."
fi
- name: Setup Rust environment
if: steps.guard.outputs.run == 'true'
uses: ./.github/actions/rust-setup
with:
components: clippy
cache-key: host-stable
install-libudev: 'true'
- name: Assert no Cargo manifest warnings
if: steps.guard.outputs.run == 'true'
run: |
out=$(cargo metadata --locked --format-version=1 2>&1 >/dev/null || true)
if echo "$out" | grep -qE "^warning:"; then
echo "$out" | grep -E "^warning:"
echo "::error::Cargo manifest emitted warnings (will become hard errors in a future Cargo release)."
exit 1
fi
- name: Clippy (workspace)
if: steps.guard.outputs.run == 'true'
run: just clippy-workspace
- name: Run tests
if: steps.guard.outputs.run == 'true'
run: just test
- name: Smoke test host-pty-server
if: steps.guard.outputs.run == 'true'
run: just host-pty-smoke