1
+ name : Tests
2
+
1
3
on :
2
4
push :
3
- branches :
4
- - master
5
- pull_request :
6
- branches :
7
- - master
8
- release :
9
- types :
10
- - created
11
-
5
+ branches : [ "*" ]
6
+
12
7
jobs :
13
- build :
8
+ test :
14
9
strategy :
15
10
matrix :
16
11
os : [macos-latest, ubuntu-latest, windows-latest]
17
12
runs-on : ${{ matrix.os }}
18
- steps :
19
- - name : Checkout
20
- uses : actions/checkout@v4
21
- - name : Run common build steps
22
- uses : ./.github/actions/common-build
23
- release-vsstudio-marketplace :
24
- runs-on : ubuntu-latest
25
- if : success() && startsWith( github.ref, 'refs/tags/')
26
- steps :
27
- - name : Checkout
28
- uses : actions/checkout@v4
29
- - name : Run common build steps
30
- uses : ./.github/actions/common-build
31
- - name : Publish Visual Studio Marketplace
32
- run : |
33
- if [ "${{ github.event_name }}" == "release" ] && [ "${{ github.event.release.prerelease }}" == "true" ]; then
34
- npm run deploy-vscode -- --pre-release
35
- else
36
- npm run deploy-vscode
37
- fi
38
- env :
39
- VSCE_PAT : ${{ secrets.VSCE_PAT }}
40
13
41
- - name : Send Slack notification
42
- if : ${{ always() }}
43
- env :
44
- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
45
- uses : 8398a7/action-slack@v3
46
- with :
47
- status : ${{ job.status }}
48
- text : " Tag: ${{ github.ref_name }} release to Visual Studio Marketplace status: ${{ job.status == 'success' && 'succeeded' || 'failed' }} :${{ job.status == 'success' && 'tada' || 'disappointed' }}:"
49
-
50
- release-openvsx-marketplace :
51
- runs-on : ubuntu-latest
52
- if : success() && startsWith( github.ref, 'refs/tags/')
53
14
steps :
54
- - name : Checkout
55
- uses : actions/checkout@v4
56
- - name : Run common build steps
57
- uses : ./.github/actions/common-build
58
- - name : Publish OpenVSX Marketplace
59
- run : |
60
- if [ "${{ github.event_name }}" == "release" ] && [ "${{ github.event.release.prerelease }}" == "true" ]; then
61
- npm run deploy-openvsx -- --pre-release
62
- else
63
- npm run deploy-openvsx
64
- fi
65
- env :
66
- OVSX_PAT : ${{ secrets.OVSX_PAT }}
15
+ - uses : actions/checkout@v3
16
+
17
+ - name : Setup Node.js
18
+ uses : actions/setup-node@v3
19
+ with :
20
+ node-version : ' 18'
21
+ cache : ' npm'
22
+ cache-dependency-path : |
23
+ package-lock.json
24
+ new_lineage_panel/package-lock.json
25
+ webview_panels/package-lock.json
26
+
27
+ - name : Install dependencies
28
+ run : |
29
+ npm ci
30
+ npm run install:panels
31
+
32
+ - name : Compile
33
+ run : npm run compile
34
+
35
+ - name : Install xvfb
36
+ if : runner.os == 'Linux'
37
+ run : |
38
+ sudo apt-get update
39
+ sudo apt-get install -y xvfb
40
+
41
+ - name : Run tests (Linux)
42
+ if : runner.os == 'Linux'
43
+ run : |
44
+ xvfb-run --auto-servernum npm run compile && xvfb-run --auto-servernum npm run test:coverage
45
+
46
+ - name : Run tests (macOS/Windows)
47
+ if : runner.os != 'Linux'
48
+ run : |
49
+ npm run compile && npm run test:coverage
50
+
51
+ - name : Upload test results
52
+ if : always()
53
+ uses : actions/upload-artifact@v3
54
+ with :
55
+ name : test-results-${{ matrix.os }}
56
+ path : test-results/
57
+
58
+ - name : Upload coverage results
59
+ if : always()
60
+ uses : actions/upload-artifact@v3
61
+ with :
62
+ name : coverage-${{ matrix.os }}
63
+ path : |
64
+ coverage/
65
+ .nyc_output/
66
+ *.lcov
67
67
68
- - name : Send Slack notification
69
- if : ${{ always() }}
70
- env :
71
- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
72
- uses : 8398a7/action-slack@v3
73
- with :
74
- status : ${{ job.status }}
75
- text : " Tag: ${{ github.ref_name }} release to openvsx marketplace status: ${{ job.status == 'success' && 'succeeded' || 'failed' }} :${{ job.status == 'success' && 'tada' || 'disappointed' }}: "
76
-
68
+ - name : Upload coverage to Codecov
69
+ if : always()
70
+ uses : codecov/codecov-action@v3
71
+ with :
72
+ token : ${{ secrets.CODECOV_TOKEN }}
73
+ directory : ./coverage/
74
+ flags : unittests
75
+ name : codecov- ${{ matrix.os }}
76
+ fail_ci_if_error : false
0 commit comments