Repository navigation
163 lines (155 loc) · 5.91 KB
/
Copy pathci.yml
File metadata and controls
163 lines (155 loc) · 5.91 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: CI
on:
pull_request:
branches: [develop]
push:
branches: [develop, main]
permissions:
contents: read
concurrency:
group: ui-ci-${{ github.ref }}
cancel-in-progress: true
jobs:
typecheck:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
with:
version: 11.9.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: pnpm
- name: Validate immutable GitHub Action runtime pins
run: node --test scripts/test-github-action-pins.mjs scripts/test-real-api-integration-workflow.mjs
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Typecheck
run: pnpm typecheck
unit-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
with:
version: 11.9.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Unit tests
run: pnpm exec vitest run
build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
with:
version: 11.9.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: |
pnpm build
node scripts/assert-production-bundle.mjs
e2e:
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
with:
version: 11.9.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile --prefer-offline
# Chromium only: the suite drives one browser against a mock of the backtest
# engine's HTTP contract, so a second engine would cost minutes and prove the
# same thing twice.
- name: Install Playwright browser
run: pnpm exec playwright install --with-deps chromium
- name: End-to-end
run: pnpm e2e
- if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-report
path: playwright-report/
retention-days: 7
real-account-api:
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: ui
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: Idea2Strategy/Idea2Strategy
ref: develop
path: root
- name: Checkout backend pinned by latest root
shell: bash
run: git -C root submodule update --init --depth 1 backend
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
with:
version: 11.9.0
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24
cache: pnpm
cache-dependency-path: ui/pnpm-lock.yaml
- uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
with:
path: ${{ runner.temp }}/a23-real-api-gradle-cache
key: real-account-gradle-${{ runner.os }}-${{ hashFiles('root/backend/**/*.gradle*', 'root/backend/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
real-account-gradle-${{ runner.os }}-
- name: Install UI dependencies
working-directory: ui
run: pnpm install --frozen-lockfile --prefer-offline
- name: Install Chromium
working-directory: ui
run: pnpm exec playwright install --with-deps chromium
- name: Confirm exact root integration
shell: bash
run: |
expected_backend="$(git -C root rev-parse HEAD:backend)"
actual_backend="$(git -C root/backend rev-parse HEAD)"
test "$expected_backend" = "$actual_backend"
echo "root=$(git -C root rev-parse HEAD)"
echo "backend=$actual_backend"
- name: Prepare writable Gradle cache
shell: bash
run: |
mkdir -p "${{ runner.temp }}/a23-real-api-gradle-cache"
chmod -R ugo+rwX "${{ runner.temp }}/a23-real-api-gradle-cache"
- name: Real account API journey
working-directory: ui
env:
A23_BACKEND_DIR: ${{ github.workspace }}/root/backend
A23_ROOT_DIR: ${{ github.workspace }}/root
A23_BACKEND_READY_TIMEOUT_SECONDS: 600
A23_GRADLE_CACHE_DIR: ${{ runner.temp }}/a23-real-api-gradle-cache
run: pnpm e2e:real-api
- if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: real-account-api-playwright-report
path: ui/playwright-report/
retention-days: 7