-
Notifications
You must be signed in to change notification settings - Fork 23
113 lines (110 loc) · 3.46 KB
/
tests.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: tests
on:
workflow_dispatch:
pull_request:
paths-ignore:
- "**.md"
push:
branches:
- develop
paths-ignore:
- "**.md"
permissions:
id-token: write
contents: read
jobs:
vsce-test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Semgrep
run: python -m pip install semgrep
- name: Setup
uses: actions/[email protected]
with:
node-version: lts/*
- name: install dependencies
run: npm ci
- uses: "aws-actions/[email protected]"
with:
role-to-assume: "arn:aws:iam::338683922796:role/semgrep-ide-integration-deploy-role"
role-duration-seconds: 900,
role-session-name: "semgrep-ide-integration-deploy"
aws-region: "us-west-2"
- if: matrix.os == 'macos-latest'
name: download osemgrep pro
run: ./download-osemgrep-pro.sh darwin-arm64
- if: matrix.os == 'ubuntu-latest'
name: download osemgrep pro
run: ./download-osemgrep-pro.sh linux-x64
- name: pretest
run: npm run pretest
- name: run native tests (Linux)
if: matrix.os == 'ubuntu-latest'
run: xvfb-run -a npm run test-native
- name: run native tests (MacOS)
if: matrix.os == 'macos-latest'
run: npm run test-native
- name: uninstall semgrep
run: python -m pip uninstall -y semgrep && rm dist/osemgrep-pro
- name: run js tests (Linux)
if: matrix.os == 'ubuntu-latest'
run: xvfb-run -a npm run test-js
- name: run js tests (MacOS)
if: matrix.os == 'macos-latest'
run: npm run test-js
- name: upload semgrep results for windows
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: semgrep-results
path: ./*_results.json
vsce-test-windows:
needs: vsce-test
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup
uses: actions/[email protected]
with:
node-version: lts/*
- name: install dependencies
run: npm ci
# This is needed so download-lspjs.sh can run
- name: configure npm
run: npm config set script-shell "C:\\Program Files\\Git\\Bin\\bash.exe"
# windows doesn't like long paths :(
- name: Support longpaths
run: git config --system core.longpaths true
- name: pretest
run: npm run pretest
- name: download semgrep results from linux
uses: actions/download-artifact@v3
with:
name: semgrep-results
path: ./
- name: run js tests (Windows)
run: npm run test-js
vsce-prepublish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
node-version: lts/*
- uses: "aws-actions/[email protected]"
with:
role-to-assume: "arn:aws:iam::338683922796:role/semgrep-ide-integration-deploy-role"
role-duration-seconds: 900,
role-session-name: "semgrep-ide-integration-deploy"
aws-region: "us-west-2"
- name: download osemgrep pro
run: ./download-osemgrep-pro.sh linux-x64
- run: npm ci
- run: npm run vscode:prepublish