Repository navigation
127 lines (119 loc) · 3.86 KB
/
Copy pathcache.yml
File metadata and controls
127 lines (119 loc) · 3.86 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
126
127
name: Warm caches
# Populates the default-branch caches that PR runs (including stacked PRs) restore from.
# Rust cache keys only depend on Cargo.lock / Cargo.toml / .cargo config / the toolchain and
# CARGO* env set in the workflows, and the Playwright cache key only depends on the e2e
# package-lock, so this only needs to run when the paths below change. The cache keys, env and
# install commands below must match ci.yml and e2e.yml.
on:
push:
branches:
- main
paths:
- '.cargo/**'
- '.github/actions/**'
- '.github/workflows/cache.yml'
- '.github/workflows/e2e.yml'
- 'Cargo.lock'
- 'Cargo.toml'
- '**/Cargo.toml'
- 'tests/e2e/package-lock.json'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Keep in sync with ci.yml and e2e.yml so Rust caches share keys.
RUST_TOOLCHAIN: 1.99.1
jobs:
clippy:
runs-on:
labels: ubuntu-latest-16-cores
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: clippy, rustfmt
- name: Restore Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: clippy
cache-on-failure: true
- name: Install Tailwind CSS
uses: ./.github/actions/install-tailwind
- name: Build clippy artifacts
run: cargo clippy --all-targets --all-features -- --deny warnings
test:
runs-on:
labels: ubuntu-latest-16-cores
env:
CARGO_PROFILE_DEV_DEBUG: line-tables-only
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Restore Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: test
cache-on-failure: true
- name: Install Tailwind CSS
uses: ./.github/actions/install-tailwind
- name: Build test artifacts
run: cargo test --no-run
e2e-server:
runs-on:
labels: ubuntu-latest-16-cores
env:
CARGO_PROFILE_DEV_DEBUG: 0
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
- name: Restore Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: e2e-server
cache-on-failure: true
- name: Install Tailwind CSS
uses: ./.github/actions/install-tailwind
- name: Build e2e server binary
run: cargo build --bin ocg-server
playwright-browsers:
runs-on:
labels: ubuntu-latest
strategy:
fail-fast: false
matrix:
browsers: [chromium, firefox, webkit]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: "22"
cache: npm
cache-dependency-path: tests/e2e/package-lock.json
- name: Install Node.js dependencies
working-directory: tests/e2e
run: npm ci
- name: Restore Playwright browsers cache
id: playwright-cache
uses: actions/cache@v5
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ matrix.browsers }}-${{ hashFiles('tests/e2e/package-lock.json') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: tests/e2e
# Headless chromium projects only need the headless shell build.
run: npx playwright install ${{ matrix.browsers == 'chromium' && '--only-shell' || '' }} ${{ matrix.browsers }}