-
Notifications
You must be signed in to change notification settings - Fork 484
130 lines (112 loc) · 5.42 KB
/
ohif-downstream.yml
File metadata and controls
130 lines (112 loc) · 5.42 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
name: OHIF Downstream Validation
# Pull requests: add a line to the PR body, same style as OHIF uses for CS3D_REF:
# OHIF_REF: <branch-or-tag>
# If omitted, Viewers ref defaults to master. workflow_dispatch can set ohif_ref instead.
on:
pull_request:
workflow_dispatch:
inputs:
ohif_ref:
description: >-
OHIF Viewers branch or tag (e.g. master, beta). On pull_request you can instead add
a line "OHIF_REF: <ref>" to the PR body.
required: false
default: 'master'
permissions:
contents: read
pull-requests: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ohif-downstream:
name: OHIF downstream tests against this PR
runs-on: self-hosted
timeout-minutes: 120
env:
BUN_VERSION: 1.3.11
NODE_VERSION: 24
OHIF_DIR: ohif
# Update to force a rebuild of the OHIF integration
BUILD_INDEX: 0
steps:
- name: Checkout Cornerstone
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
- name: Resolve OHIF ref (PR body OHIF_REF line or workflow_dispatch input)
run: bash scripts/ci/ohif-ref-resolve.sh
env:
GH_TOKEN: ${{ github.token }}
EVENT_NAME: ${{ github.event_name }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
OHIF_REF_INPUT: ${{ github.event.inputs.ohif_ref }}
DEFAULT_REF: master
- name: Log build context (OHIF/CS3D branch and version for build diagnosis)
run: |
echo "::notice::Build type: ohif-downstream | CS3D: ${{ github.repository }}@${{ github.ref }} (${{ github.sha }}) | OHIF ref: ${{ env.OHIF_REF }}"
CS3D_BRANCH=$(git rev-parse --abbrev-ref HEAD)
CS3D_SHA=$(git rev-parse --short HEAD)
echo "[build-context] ═══════════════════════════════════════════════════════════════"
echo "[build-context] Build type: ohif-downstream (CS3D repo validating against OHIF)"
echo "[build-context] CS3D branch: $CS3D_BRANCH | CS3D SHA: $CS3D_SHA"
echo "[build-context] OHIF ref: ${{ env.OHIF_REF }}"
echo "[build-context] ═══════════════════════════════════════════════════════════════"
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install Cornerstone dependencies
run: bun install --frozen-lockfile
- name: Build local Cornerstone packages for OHIF
run: bun run build:esm
- name: Checkout OHIF
uses: actions/checkout@v4
with:
repository: OHIF/Viewers
ref: ${{ env.OHIF_REF }}
path: ${{ env.OHIF_DIR }}
fetch-depth: 1
submodules: recursive
- name: Log build context (OHIF/CS3D branch and version for build diagnosis)
run: |
CS3D_BRANCH=$(git rev-parse --abbrev-ref HEAD)
CS3D_SHA=$(git rev-parse HEAD)
OHIF_BRANCH=$(git -C "${OHIF_DIR}" rev-parse --abbrev-ref HEAD)
OHIF_SHA=$(git -C "${OHIF_DIR}" rev-parse HEAD)
echo "::notice::Build type: ohif-downstream | OHIF: OHIF/Viewers@${OHIF_BRANCH} (${OHIF_SHA}) | CS3D: ${{ github.repository }}@${CS3D_BRANCH} (${CS3D_SHA})"
echo "[build-context] ═══════════════════════════════════════════════════════════════"
echo "[build-context] Build type: ohif-downstream (CS3D repo validating against OHIF)"
echo "[build-context] OHIF checkout: ${OHIF_BRANCH} (${OHIF_SHA}) | CS3D checkout: ${CS3D_BRANCH} (${CS3D_SHA})"
echo "[build-context] ═══════════════════════════════════════════════════════════════"
- name: Install OHIF dependencies
working-directory: ${{ env.OHIF_DIR }}
run: bun install --frozen-lockfile
- name: Link local Cornerstone packages into OHIF node_modules
run: node scripts/link-ohif-cornerstone-node-modules.mjs ${{ env.OHIF_DIR }}
- name: Run OHIF unit tests
working-directory: ${{ env.OHIF_DIR }}
run: bun run test:unit:ci
- name: Install Playwright browsers
working-directory: ${{ env.OHIF_DIR }}
run: npx playwright install
- name: Run OHIF e2e tests
working-directory: ${{ env.OHIF_DIR }}
env:
PLAYWRIGHT_HTML_OPEN: never
run: bun run test:e2e:ci
- name: Upload OHIF Playwright artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ohif-playwright-artifacts-${{ github.sha }}
path: |
${{ env.OHIF_DIR }}/tests/playwright-report.json
${{ env.OHIF_DIR }}/tests/playwright-report/
${{ env.OHIF_DIR }}/tests/test-results/
retention-days: 7