-
Notifications
You must be signed in to change notification settings - Fork 1
137 lines (118 loc) · 3.96 KB
/
Copy pathci.yml
File metadata and controls
137 lines (118 loc) · 3.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
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
128
129
130
131
132
133
134
135
136
137
name: CI
on:
push:
branches: [main, dev, release/*, feature/*]
pull_request:
branches: [main, dev, release/*]
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
github:
if: ${{ github.server_url == 'https://github.com' }}
name: GitHub Use-Case Bundle
runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'rust' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
with:
workspaces: |
uc-deliveries
uc-fsr
uc-hospital
uc-lessons
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
cache-dependency-path: package-lock.json
- name: Install browser test dependencies
run: make install-e2e
- name: Run bundle CI
run: make ci-local
- name: Upload browser artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: usecase-browser-artifacts
path: |
test-results
playwright-report
uc-*/test-results
uc-*/playwright-report
if-no-files-found: ignore
forgejo:
if: ${{ github.server_url != 'https://github.com' }}
name: Forgejo Use-Case Bundle
runs-on: ${{ github.server_url == 'https://github.com' && 'ubuntu-latest' || 'rust' }}
steps:
- name: Checkout repository
env:
CHECKOUT_SHA: ${{ github.sha }}
PRIMARY_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}.git
FALLBACK_REPOSITORY_URL: http://host.containers.internal:3002/${{ github.repository }}.git
run: |
set -eu
git init .
git remote add origin "$PRIMARY_REPOSITORY_URL"
if ! git fetch --depth 1 origin "$CHECKOUT_SHA"; then
git remote set-url origin "$FALLBACK_REPOSITORY_URL"
git fetch --depth 1 origin "$CHECKOUT_SHA"
fi
git checkout --force --detach FETCH_HEAD
- name: Install runner system dependencies
run: |
set -eu
apt-get update
apt-get install -y --no-install-recommends ca-certificates chromium cmake ripgrep
- name: Install Rust
run: |
set -eu
cargo_bin="${CARGO_HOME:-$HOME/.cargo}/bin"
if [ ! -x "$cargo_bin/rustup" ]; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| sh -s -- -y --profile minimal --component rustfmt,clippy
cargo_bin="$HOME/.cargo/bin"
fi
export PATH="$cargo_bin:$PATH"
rustup toolchain install stable --profile minimal --component rustfmt,clippy
rustup default stable
if [ -n "${GITHUB_PATH:-}" ]; then
echo "$cargo_bin" >> "$GITHUB_PATH"
fi
rustc --version
cargo --version
rustfmt --version
cargo clippy --version
- name: Check Node
run: |
node --version
npm --version
- name: Install browser test dependencies
run: make install-e2e
- name: Run bundle CI
env:
CHROMIUM_PATH: /usr/bin/chromium
PLAYWRIGHT_CHROMIUM_EXECUTABLE: /usr/bin/chromium
run: |
export PATH="${CARGO_HOME:-$HOME/.cargo}/bin:$PATH"
make ci-local
- name: List browser artifacts on failure
if: failure()
run: |
set -eu
for path in test-results playwright-report uc-*/test-results uc-*/playwright-report; do
if [ -e "$path" ]; then
find "$path" -maxdepth 2 -type f -print
fi
done