-
Notifications
You must be signed in to change notification settings - Fork 3
149 lines (129 loc) · 5.98 KB
/
Copy pathtests.yml
File metadata and controls
149 lines (129 loc) · 5.98 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
name: Tests
# Runs on pushes to main as well as PRs. This used to be pull_request-only,
# which meant it silently stopped running once work started going straight to
# main -- it last ran in April while main kept moving.
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
# No build step needed: no remaining spec imports the workspace libraries
# from dist/, so this passes on a clean checkout.
- name: Test
run: npm test
# The type-aware lint rules and knip both need the workspace libraries to
# resolve. Without dist/ they report against a different graph than they do
# locally, so the baselines drift -- which already failed one run with
# "Cannot find module 'reactome-gsa-form'". Build them first so CI and a
# developer's machine are looking at the same code.
- name: Build workspace libraries
run: npm run build:libs
# The app build is the only thing that runs Angular's template type
# checking, and strictTemplates is on: a template referencing a member
# that does not exist, binding an input on a component it never imported,
# or using a pipe that is not in scope fails here. None of that shows up
# in the unit tests -- a merge once landed a dead @if block that compiled
# and passed every test. Without this step the only build was the deploy
# job, so a broken template reached main and was found by a person.
#
# content-dist is a gitignored asset input, so stage:content has to run or
# ng build cannot find it. The libraries no longer need a step of their
# own: `npm run build` builds them, because a build that does not produce
# what it links against is a build that can pass here and ship something
# else -- a fix to reactome-cytoscape-style reached CI and never reached
# the dev server, which builds the app without building the library.
- name: Compile CMS content
run: npm run stage:content
- name: Build the app
run: npm run build
# Lint errors must be zero -- eslint.config.js only marks a rule "error"
# once the codebase is clean of it, so an error is always a new violation.
# Warnings are the ~1600 pre-existing findings, held to a baseline so they
# can only go down.
# Formatting is checked, not applied. The previous workflow ran prettier
# on PR branches and pushed a commit back -- it used yarn in an npm repo
# and prettier was never a dependency, so it silently formatted nothing
# for months, and it could not run at all once work went straight to main.
- name: Check formatting
run: npm run format:check
- name: Lint
run: npm run check:lint
# eslint sees unused symbols within a file; knip sees whole files and
# exports nothing imports, which was the bigger pile. Also baselined,
# because some findings need someone who knows the data model to judge --
# the graph classes are referenced by schemaClass name, not by import.
- name: Check unreachable code has not increased
run: npm run check:dead
e2e:
# The code suite only: "is the code right?". The release checks -- every
# top-level pathway draws, every download link resolves, the version and news
# and statistics match what is being served -- depend on generated release
# data this runner does not have, and live in release-verification.yml.
#
# Still sharded: playwright splits by test, so coverage is unchanged and the
# wall clock stays a few minutes rather than the 30 that got a job killed.
name: End-to-end (${{ matrix.shard }}/4)
runs-on: ubuntu-latest
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci --legacy-peer-deps
# src/styles.scss @use's all three of these from dist/, and the
# pathway-browser build copies reactome-cytoscape-style's assets, so the
# app cannot be served until they exist.
- name: Build workspace libraries
run: npm run build:libs
# site-search-index.json is generated, not committed, and the search
# specs depend on it.
- name: Generate content indices and compile content
run: |
npm run generate:indices
npm run stage:content
- name: Install Playwright browser
run: npx playwright install --with-deps chromium
# playwright.config.ts starts `ng serve` itself and waits for :4200.
# Backend calls go through proxy.conf.js, which defaults to the Tomcat on
# localhost:8080 that the Reactome dev host runs. A CI runner has no such
# backend, so point it at production or every data-dependent test hangs
# until the job's 30 minute limit -- which is exactly what happened when
# the default was switched to localhost.
#
# Production lacks the content-page endpoints that only exist on the dev
# host's unreleased branch; the specs needing those skip themselves rather
# than fail here.
- name: Run e2e
env:
REACTOME_BACKEND: https://reactome.org
run: npm run e2e -- --shard=${{ matrix.shard }}/4
- name: Upload Playwright report
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
# One name per shard: artifacts with the same name collide and the
# upload fails, losing the report exactly when it is wanted.
name: playwright-report-${{ matrix.shard }}
path: playwright-report/
retention-days: 7