-
Notifications
You must be signed in to change notification settings - Fork 33
87 lines (85 loc) · 2.92 KB
/
test-npm-package.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
name: Test npm package
on:
push:
branches:
- master
paths:
- '.github/actions/build-setup/**/*'
- '.github/actions/install-playwright-browser/**/*'
- '.github/workflows/test-npm-package.yml'
- 'scripts/**/*'
- 'src/**/*'
- 'test/config/**/*'
- 'test/bundles/**/*'
- 'test/typescript-support/**/*'
- 'test/typescript-moduleResolution-bundler/**/*'
- '.nvmrc'
- 'package.json'
- 'package-lock.json'
- 'rollup.config.mjs'
- 'tsconfig.json'
pull_request:
branches:
- master
paths:
- '.github/actions/build-setup/**/*'
- '.github/actions/install-playwright-browser/**/*'
- '.github/workflows/test-npm-package.yml'
- 'scripts/**/*'
- 'src/**/*'
- 'test/bundles/**/*'
- 'test/config/**/*'
- 'test/shared/**/*'
- 'test/typescript-support/**/*'
- 'test/typescript-moduleResolution-bundler/**/*'
- '.nvmrc'
- 'package.json'
- 'package-lock.json'
- 'rollup.config.mjs'
- 'tsconfig.json'
jobs:
build_and_test_npm_package:
runs-on: ubuntu-22.04
env:
test-bundles-browser: chromium
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Setup
uses: ./.github/actions/build-setup
- name: Build npm package
run: npm pack
- name: Upload npm package
uses: actions/upload-artifact@v4
with:
name: bpmn-visualization-npm-package-${{github.sha}}
path: bpmn-visualization-*.tgz
- name: Install ${{env.test-bundles-browser}}
uses: ./.github/actions/install-playwright-browser
with:
browser: ${{env.test-bundles-browser}}
- name: Test bundles
id: 'test_bundles'
env:
BROWSERS: ${{env.test-bundles-browser}}
run: npm run test:bundles:verbose
- name: Upload bundles test results
if: ${{ failure() && steps.test_bundles.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: bundles-test-results-${{github.sha}}
path: build/test-report/bundles
# Check the minimal TS version required to use bpmn-visualization
- name: Setup typescript-support test
working-directory: 'test/typescript-support'
run: npm install --ignore-scripts --prefer-offline --audit false
- name: Run typescript-support test
working-directory: 'test/typescript-support'
run: npm test
# Check the "exports" field in package.json: project using moduleResolution=bundler in tsconfig.json
- name: Setup typescript-moduleResolution-bundler test
working-directory: 'test/typescript-moduleResolution-bundler'
run: npm install --ignore-scripts --prefer-offline --audit false
- name: Run typescript-moduleResolution-bundler test
working-directory: 'test/typescript-moduleResolution-bundler'
run: npm test