-
Notifications
You must be signed in to change notification settings - Fork 7
91 lines (80 loc) · 2.97 KB
/
build-canvas.yml
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
on:
workflow_call:
inputs:
node_version:
type: string
description: 'Node.js version'
required: true
app_env:
type: string
description: 'Application environment'
required: true
app_version:
type: string
description: 'Application version'
required: true
canvas_theme_js_file:
type: string
description: 'Canvas theme JS file'
required: true
canvas_theme_css_file:
type: string
description: 'Canvas theme CSS file'
required: true
canvas_username:
type: string
description: 'Canvas username'
required: true
secrets:
canvas_password:
description: 'Canvas password'
required: true
jobs:
build-canvas:
name: Build - Canvas
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
- name: Cache pnpm packages
uses: actions/cache@v4
with:
path: ~/.pnpm-store
key: pnpm-cache
restore-keys: |
pnpm-
- name: Install PNPM and Dependencies
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
- name: Cache Playwright dependencies
id: playwright-cache
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-cache
restore-keys: |
playwright-
- name: Install Playwright dependencies
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm exec playwright install --with-deps
- name: Run Playwright Tests
run: pnpm exec playwright test ./tests/canvas/build-theme.spec.js
env:
APP_ENV: ${{ inputs.app_env }}
APP_VERSION: ${{ inputs.app_version }}
THEME_JS_FILE: ${{ inputs.canvas_theme_js_file }}
THEME_CSS_FILE: ${{ inputs.canvas_theme_css_file }}
BASIC_AUTH_USERNAME: ${{ inputs.canvas_username }}
BASIC_AUTH_PASSWORD: ${{ secrets.canvas_password }}
CI: true
- name: Generate Markdown Report
id: generate-markdown
run: node .github/playwright/markdown-reporter.js
- name: Upload Markdown Report to GitHub Summary
run: |
cat ./playwright-report/report.md >> $GITHUB_STEP_SUMMARY