Repository navigation
125 lines (112 loc) · 3.89 KB
/
Copy pathtest.yml
File metadata and controls
125 lines (112 loc) · 3.89 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Test
on:
workflow_call:
inputs:
app:
description: Application to test (elph)
required: false
type: string
default: elph
sharedKeyPrefix:
description: Cache key prefix
required: false
type: string
default: ci
mode:
description: full = fmt+check+lint+test+debug build; check = fmt+check+lint
required: false
type: string
default: full
os:
description: Restrict the matrix to a single platform (linux/macos/windows). Empty runs all.
required: false
type: string
default: ""
workflow_dispatch:
inputs:
os:
description: Platform to test
required: false
type: choice
options:
- all
- linux
- macos
- windows
default: all
# push:
# branches: [main]
# paths:
# - "crates/coding-agent/**"
# - "crates/elph-agent/**"
# - "crates/elph-ai/**"
# - "crates/elph-tui/**"
# - "Cargo.toml"
# - "Cargo.lock"
# - "rust-toolchain.toml"
# - "Makefile"
# - ".github/**"
pull_request:
paths:
- "crates/coding-agent/**"
- "crates/elph-agent/**"
- "crates/elph-ai/**"
- "crates/elph-tui/**"
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain.toml"
- "Makefile"
- ".github/**"
permissions:
contents: read
concurrency:
# Include inputs.os so the release pipeline's per-OS check jobs
# (linux/macos/windows, invoked via workflow_call) each get a distinct group
# and run in parallel. For pull_request runs os is empty, so all matrix legs
# share the group and cancel-in-progress still applies per PR.
group: test-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ inputs.os || '' }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CI: true
BINSTALL_DISABLE_TELEMETRY: true
jobs:
test:
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include: ${{ ((inputs.os || 'all') == 'all') && fromJson('[{"name":"linux","runner":"avrea-ubuntu-24.04-4-vcpu","cacheBackend":"namespace"},{"name":"macos","runner":"avrea-macos-26-8-vcpu","cacheBackend":"namespace"},{"name":"windows","runner":"avrea-windows-2025-4-vcpu","cacheBackend":"avrea","timeoutMinutes":90}]') || fromJson(format('[{{"name":"{0}","runner":"{1}","cacheBackend":"{2}"}}]', inputs.os || 'all', fromJson('{"linux":"avrea-ubuntu-24.04-4-vcpu","macos":"avrea-macos-26-8-vcpu","windows":"avrea-windows-2025-4-vcpu"}')[inputs.os || 'all'], fromJson('{"linux":"namespace","macos":"namespace","windows":"avrea"}')[inputs.os || 'all'])) }}
runs-on: ${{ matrix.runner }}
timeout-minutes: ${{ matrix.timeoutMinutes || 45 }}
env:
# sccache via the Avrea WebDAV endpoint (no R2/S3) — Windows only.
CARGO_INCREMENTAL: ${{ matrix.name == 'windows' && '0' || '' }}
steps:
- uses: actions/checkout@v7
- name: Setup Rust
uses: ./.github/setup-rust
with:
sharedKey: ${{ inputs.sharedKeyPrefix || 'ci' }}-${{ inputs.app || 'elph' }}-${{ matrix.name }}
cacheBackend: ${{ matrix.cacheBackend }}
saveCache: ${{ github.ref == 'refs/heads/main' || matrix.name == 'windows' }}
- name: Check format
shell: bash
run: cargo fmt --all --check
- name: Check compile
shell: bash
run: make check
- name: Lint
shell: bash
run: make lint
- name: Test
if: (inputs.mode || 'full') == 'full'
shell: bash
run: make test
- name: Build debug
if: (inputs.mode || 'full') == 'full'
shell: bash
run: make build
- name: Show sccache stats
if: always()
uses: ./.github/show-sccache-stats