-
Notifications
You must be signed in to change notification settings - Fork 3
83 lines (71 loc) · 1.95 KB
/
node.js.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
name: Draw.io Plugin CI
on:
push:
paths:
- '.github/workflows/node.js.yml'
- 'docker/**'
- 'src/**'
- 'package-lock.json'
- 'package.json'
- '**.ts'
- '**.js'
pull_request:
paths:
- '.github/workflows/node.js.yml'
- 'docker/**'
- 'src/**'
- 'package-lock.json'
- 'package.json'
- '**.ts'
- '**.js'
jobs:
# https://github.com/orgs/community/discussions/27031#discussioncomment-3254376
pre_job:
name: Check duplicate
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
skip_after_successful_duplicate: 'true'
concurrent_skipping: 'same_content_newer'
build:
name: Build Draw.io Plugin
runs-on: ubuntu-latest
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Use Node.js 16.x
uses: actions/setup-node@v4
with:
node-version: 16.x
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm run lint
- name: Install Playwright
run: npx playwright install --with-deps
- name: Create Docker image for Draw.io webserver
run: npm run docker
- name: Start draw.io webserver
run: npm run start
- name: Run Playwright tests
run: npm run test
- name: Archive Playwright test results
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-test-results
path: test-results/
- name: Stop webserver
if: always()
run: npm run stop
- name: Archive compiled plugin
uses: actions/upload-artifact@v4
with:
name: plugin
path: dist/attackgraphs.js