-
Notifications
You must be signed in to change notification settings - Fork 10
116 lines (111 loc) · 3.85 KB
/
ci-linux.yml
File metadata and controls
116 lines (111 loc) · 3.85 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
107
108
109
110
111
112
113
114
115
116
name: Checkmarx One Vscode Extension CI Linux Test cases
on: [pull_request]
jobs:
# Test the shared core package independently
core-unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22.11.0
- name: Authenticate with GitHub package registry
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN }}" > ~/.npmrc
- name: Install dependencies
run: |
npm run install:all
- name: Run core unit tests with coverage
run: npm run unit-coverage:test:core
- name: Upload core coverage report
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4
with:
name: coverage-core
path: packages/core/coverage/
retention-days: 7
# Test both extensions with E2E tests
end-to-end-tests:
strategy:
max-parallel: 1
matrix:
extension: [checkmarx]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22.11.0
- name: Authenticate with GitHub package registry
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN }}" > ~/.npmrc
- name: Install dependencies
run: |
npm run install:all
- name: Build all packages
run: npm run build:all
- name: Run e2e tests
if: runner.os == 'Linux'
env:
CX_APIKEY: ${{ secrets.CX_APIKEY_E2E_DEU }}
run: |
sudo apt-get install xvfb
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1920x1080x16 &
npm run e2e:test:checkmarx
- name: Upload test artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4
with:
name: e2e-artifacts-${{ matrix.extension }}-${{ matrix.os }}
path: |
packages/core/test-resources/screenshots/*.png
retention-days: 2
# Run integration tests for both extensions
ui-tests:
strategy:
max-parallel: 1
matrix:
extension: [checkmarx]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22.11.0
- name: Authenticate with GitHub package registry
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN }}" > ~/.npmrc
- name: Install dependencies
run: |
npm run install:all
- name: Build all packages
run: npm run build:all
- name: Run integration tests (Linux)
if: runner.os == 'Linux'
env:
CX_API_KEY: ${{ secrets.API_KEY }}
CX_TEST_SCAN_ID: ${{ secrets.TEST_SCAN_ID }}
run: |
sudo apt-get install xvfb
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1920x1080x16 &
npm run ui:test:checkmarx
- name: Upload test artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4
with:
name: integration-artifacts-${{ matrix.extension }}-${{ matrix.os }}
path: |
packages/core/test-resources/screenshots/*.png
retention-days: 2
- name: Upload screenshots
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 #v4
if: failure() && runner.os == 'macOS'
with:
name: screenshots-${{ matrix.extension }}
path: /Users/runner/work/ast-vscode-extension/ast-vscode-extension/packages/core/test-resources/screenshots/*.png