-
Notifications
You must be signed in to change notification settings - Fork 11
94 lines (78 loc) · 2.95 KB
/
plotlyTestCoverage.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
92
93
94
name: "Plotly Test coverage"
on:
pull_request:
types: [synchronize]
workflow_dispatch:
inputs:
repo:
description: "Repo to run the tests on"
required: true
default: "microsoft/fluentui"
branch:
description: "Branch to run the tests on"
required: true
default: "master"
#Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
jobs:
run_tests:
strategy:
matrix:
os: [windows-latest]
runs-on: ${{matrix.os}}
outputs:
test_coverage: ${{steps.run_tests.outputs}}
windows_artifact_name: ${{ steps.windows.outputs.COVERAGE_FILENAME_WINDOWS}}
steps:
- name: Checkout [master]
uses: actions/checkout@v4
- name: Checkout [react-charting]
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.repo || 'microsoft/fluentui'}}
ref: ${{ github.event.inputs.branch || 'master'}}
path: repo1
- name: Show current directory
run: echo "$PWD" && ls
- name: Show repo1 respository
run: ls ./repo1
- name: Set up node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install packgaes
run: yarn --cwd ./repo1 && yarn --cwd ./repo1/packages/charts/react-charting
- name: Intall nx globally
run: yarn global add nx
- name: Build
run: yarn --cwd ./repo1 && yarn nx run react-charting:build
- name: Run yarn pack to create .tgz file
run: |
cd ./repo1/packages/charts/react-charting
yarn pack --filename react-charting.tgz
id: pack
- name: Install .tgz file in Plotly examples
run: |
cd apps/plotly_examples
rm -rf node_modules
yarn add ../rep1/packages/charts/react-charting/react-charting.tgz
yarn install
- name: Locally run the test app
run: |
cd apps/plotly_examples
npm start
- name: Run playwright test script
run: |
cd apps/plotly_examples
npx cross-env BASE_URL='http://localhost:3000/' npx playwright test
- name: Open Playwright report
run: |
npx playwright test --reporter=html --output=apps/plotly_examples/playwright-report/
- name: Upload playwright report as artifact
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: apps/plotly_examples/playwright-report/