Skip to content

feat(infinity-slack-bot): "Compact session" message shortcut #700

feat(infinity-slack-bot): "Compact session" message shortcut

feat(infinity-slack-bot): "Compact session" message shortcut #700

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
pre_job:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf # v5.3.1
lint:
name: Lint
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
timeout-minutes: 30
needs: pre_job
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libcap-dev
- uses: ./.github/actions/use-sccache
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 20
- name: Check formatting
run: cargo fmt --all --check
- name: Check docs formatting
run: |
cd docs && npm ci && npm run format:check
- name: Check infinity-ui formatting
run: |
cd infinity-ui && npm ci && npm run format:check
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Check licenses (THIRD-PARTY)
run: |
cargo install --locked cargo-about --features cli
bash scripts/generate-third-party.sh
git diff --exit-code THIRD-PARTY || (echo "THIRD-PARTY file is stale. Run 'bash scripts/generate-third-party.sh' and commit." && exit 1)
test:
name: Test (${{ matrix.os }})
if: ${{ needs.pre_job.outputs.should_skip != 'true' || github.event_name != 'pull_request' }}
timeout-minutes: 30
needs: pre_job
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update && sudo apt-get install -y libcap-dev
echo "kernel.apparmor_restrict_unprivileged_userns = 0" | sudo tee /etc/sysctl.d/99-userns.conf
sudo sysctl --system
- uses: ./.github/actions/use-sccache
- name: Install jj
uses: taiki-e/install-action@0758d235715de2f3551eacc980d9ae8fce9342c3 # v2
with:
tool: jj-cli
- name: Run tests
run: cargo test --all-targets
# `--all-targets` does not include doctests, which cover the rustdoc
# examples in library crates and the documentation example tests
# (crates/infinity-mdtests).
- name: Run doctests
run: cargo test --doc
# Web UI e2e tests run only on Linux: they need a Playwright browser
# and the goldens are rendered with Linux font rendering.
- name: Setup Node.js (Linux)
if: runner.os == 'Linux'
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 20
- name: Install Playwright driver + browsers (Linux)
if: runner.os == 'Linux'
# Version must match the driver bundled by playwright-rs (1.60.0).
#
# playwright-rs's build script downloads its driver from a CDN that
# has proven unreliable (404s), so skip it and point the runtime at
# the npm-installed driver instead (same mechanism check.bash
# documents for old-glibc hosts): with PLAYWRIGHT_SKIP_DRIVER_DOWNLOAD
# the bundled-driver lookup is empty and resolution falls through to
# PLAYWRIGHT_NODE_EXE + PLAYWRIGHT_CLI_JS.
run: |
mkdir -p "$RUNNER_TEMP/pw-driver"
(cd "$RUNNER_TEMP/pw-driver" && npm install playwright@1.60.0)
echo "PLAYWRIGHT_SKIP_DRIVER_DOWNLOAD=1" >> "$GITHUB_ENV"
echo "PLAYWRIGHT_NODE_EXE=$(command -v node)" >> "$GITHUB_ENV"
echo "PLAYWRIGHT_CLI_JS=$RUNNER_TEMP/pw-driver/node_modules/playwright/cli.js" >> "$GITHUB_ENV"
npx playwright@1.60.0 install --with-deps chromium
- name: Run web UI e2e tests (Linux)
if: runner.os == 'Linux'
run: cargo test -p infinity-daemon --features e2e-web --test web_e2e
# On screenshot mismatches the test writes `-actual`/`-diff` PNGs next
# to the goldens; upload them so mismatches can be reviewed (and, if
# the differences are benign rendering drift, used to decide on a
# tolerance bump or regenerated goldens).
- name: Upload web e2e screenshots (Linux)
if: failure() && runner.os == 'Linux'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: web-e2e-screenshots
path: crates/infinity-daemon/tests/web_snapshots/
if-no-files-found: ignore
test-all:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Test Suite Result (Full Matrix)
needs: [test]
steps:
- run: |
result="${{ needs.test.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi