-
-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (89 loc) · 2.84 KB
/
Copy pathpr-validate.yml
File metadata and controls
106 lines (89 loc) · 2.84 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
name: PR Validation - Test and Build
on:
pull_request:
branches:
- master
- main
paths-ignore:
- '*.md'
- '.vscode/**'
- '.idea/**'
workflow_dispatch:
concurrency:
group: pr-validation-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
version: 'latest'
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v5
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install Dependencies
run: pnpm install
- name: Install Playwright Browser
if: ${{ hashFiles('wiki/tiddlers/tests/playwright/**/*.ts') != '' }}
run: pnpm exec playwright install --with-deps chromium
- name: Lint Code
run: pnpm exec eslint ./src --max-warnings 0
continue-on-error: true
- name: Run Tests
run: pnpm run test
- name: Run Playwright E2E Tests
if: ${{ hashFiles('wiki/tiddlers/tests/playwright/**/*.ts') != '' }}
run: pnpm run test:playwright
- name: Build Plugins
run: pnpm run build
- name: Build Static Website
run: pnpm run publish
- name: Upload Build Artifacts
if: always()
uses: actions/upload-artifact@v7
with:
name: build-artifacts
path: dist/
retention-days: 5
- name: Comment PR with Results
if: failure() && github.event_name == 'pull_request'
uses: actions/github-script@v9
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ PR validation failed. Please check the workflow logs for details.'
})
- name: Comment PR with Success
if: success() && github.event_name == 'pull_request'
uses: actions/github-script@v9
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '✅ PR validation passed successfully!'
})