Repository navigation
95 lines (91 loc) · 3.88 KB
/
Copy pathrust.yml
File metadata and controls
95 lines (91 loc) · 3.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Rust
# Pushes to main run these checks through testing-build.yml, which calls this
# workflow before it publishes packages.
on:
pull_request:
branches: [main]
workflow_dispatch:
workflow_call:
inputs:
linux-runner:
description: Runner label for the Linux leg
type: string
default: ubuntu-24.04
permissions:
contents: read
# In a called workflow github.workflow names the caller, so a direct run and a
# Testing build run on the same ref never cancel each other.
concurrency:
group: ${{ github.workflow }}-rust-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check:
name: Rust (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: ["${{ inputs.linux-runner || 'ubuntu-24.04' }}", windows-2025]
runs-on: ${{ matrix.os }}
timeout-minutes: 40
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install the pinned toolchain
run: rustup toolchain install 1.99.1 --profile minimal --component rustfmt --component clippy
- name: Check formatting
run: cargo fmt --all -- --check
- name: Install the desktop shell's Linux build packages
if: runner.os == 'Linux'
run: |
# The Tauri prerequisites for Debian and Ubuntu. They are needed to
# compile the desktop crate; no test here starts a webview.
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev \
libssl-dev libayatana-appindicator3-dev librsvg2-dev
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- name: Build the desktop frontend
# The desktop crate embeds ui/dist at compile time, so the frontend
# must be built before any workspace-wide Cargo step.
working-directory: crates/omgcode-desktop/ui
run: |
npm ci --ignore-scripts
npm run build
- name: Check lints and compilation
run: cargo clippy --workspace --all-targets --locked -- -D warnings
- name: Start a user service manager for delegated cgroups
if: runner.os == 'Linux'
run: |
sudo loginctl enable-linger "$USER"
runtime_dir="/run/user/$(id -u)"
for _ in $(seq 1 50); do
[ -S "$runtime_dir/bus" ] && break
sleep 0.2
done
echo "XDG_RUNTIME_DIR=$runtime_dir" >> "$GITHUB_ENV"
echo "DBUS_SESSION_BUS_ADDRESS=unix:path=$runtime_dir/bus" >> "$GITHUB_ENV"
XDG_RUNTIME_DIR="$runtime_dir" systemd-run --user --scope --quiet -p Delegate=yes -- cat /proc/self/cgroup
- name: Start an unlocked Secret Service for credential tests
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gnome-keyring
# One empty line is an empty password. It creates and unlocks the
# login collection, which becomes the default alias; empty input
# (no newline) creates no collection.
printf '\n' | gnome-keyring-daemon --unlock --components=secrets
for _ in $(seq 1 50); do
busctl --user call org.freedesktop.secrets /org/freedesktop/secrets \
org.freedesktop.Secret.Service ReadAlias s default 2>/dev/null \
| grep -q '/collection/' && break
sleep 0.2
done
busctl --user call org.freedesktop.secrets /org/freedesktop/secrets \
org.freedesktop.Secret.Service ReadAlias s default | grep '/collection/'
- name: Run tests
run: cargo test --workspace --all-targets --locked
- name: Run documentation tests
run: cargo test --workspace --doc --locked