Repository navigation
77 lines (72 loc) · 2.96 KB
/
Copy pathpc-mate.yml
File metadata and controls
77 lines (72 loc) · 2.96 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
name: PC-Mate
on:
workflow_call:
inputs:
suites:
description: Scope already selected by the Main orchestrator
required: true
type: string
workflow_dispatch:
permissions:
contents: read
actions: read
concurrency:
group: pc-mate-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
changes:
if: ${{ inputs.suites == '' }}
uses: ./.github/workflows/ci-changes.yml
with:
baseline-workflow: pc-mate.yml
check:
needs: changes
# The suite key contains a hyphen, so it is read as a subscript rather than a property.
if: >-
${{ !cancelled() &&
((inputs.suites == '' && needs.changes.result != 'success') ||
fromJSON(inputs.suites || needs.changes.outputs.suites || '{}')['pc-mate']) }}
runs-on: powercontext-ci-light
# Cold dependency build plus tests; the workspace is independent of the Gateway.
timeout-minutes: 30
# Every `run:` step works inside the workspace so `rust-toolchain.toml` is the pin that applies,
# the same arrangement the Desktop jobs use.
defaults:
run:
working-directory: pc-mate
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
# Install only; the selection comes from `pc-mate/rust-toolchain.toml`. This job sets
# `working-directory: pc-mate` instead of passing `--manifest-path` from the repository root,
# because rustup reads the toolchain file relative to the working directory and never looks at
# the manifest path — running from the root would compile with the runner's default toolchain
# while the job claimed to pin 1.95.0.
- name: Install pinned Rust toolchain
run: rustup toolchain install 1.95.0 --profile minimal --component rustfmt --component clippy
- name: Cache Rust dependencies and compilation
id: cargo-cache
uses: ./.github/actions/setup-rust-cache
with:
workspaces: pc-mate -> target
shared-key: pc-mate
cache-bin: false
cache-on-failure: true
- name: Format check
run: cargo fmt --all --check
- name: Lint
run: cargo clippy --locked --all-targets -- -D warnings
- name: Test
run: cargo test --locked
- name: Build
run: cargo build --locked
# The internal backend is restored but never saved on its own: `cache-on-failure` configures the
# hosted backend only, so this workspace never populated its `pc-mate` snapshots. Same
# conditional save the Gateway job uses.
- name: Save Rust dependencies and compilation
if: (success() || failure()) && steps.cargo-cache.outputs.cache-backend == 's3' && steps.cargo-cache.outputs.cache-hit != 'true'
uses: ./.github/actions/cache-save
with:
path: ${{ steps.cargo-cache.outputs.cache-path }}
key: ${{ steps.cargo-cache.outputs.cache-key }}