-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (99 loc) · 2.93 KB
/
ci.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
name: CI
on:
workflow_dispatch:
push:
branches:
- main
tags:
- '*'
pull_request:
permissions:
contents: write
jobs:
qodana-jvm:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
fetch-depth: 0 # a full history is required for pull request analysis
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2023.2
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_JVM }} # read the steps about it below
qodana-js:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
fetch-depth: 0 # a full history is required for pull request analysis
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2023.2
with:
args: -i,vscode/qodana
pr-mode: false
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_JS }} # read the steps about it below
build:
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
cache: gradle
- name: Run Java tests
run: ./gradlew test
- name: Build Fat jar
run: ./gradlew shadowJar
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18.16'
- name: Install dependencies
run: npm install -g vsce && npm ci
working-directory: vscode/qodana
- name: Run ts tests
run: xvfb-run -a npm run test
working-directory: vscode/qodana
if: matrix.os == 'ubuntu-latest'
- name: Run ts tests
run: npm run test
working-directory: vscode/qodana
if: runner.os != 'Linux'
- name: Package
run: npm run package
working-directory: vscode/qodana
- name: Save artifact
uses: actions/upload-artifact@v2
if: matrix.os == 'ubuntu-latest'
with:
name: qodana
path: vscode/qodana/*.vsix
- name: Publish
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
run: |
gh release create ${GITHUB_REF##*/}
vsce publish -p ${{ secrets.VSCE_PAT }} -i qodana-cloud-plugin.vsix
working-directory: vscode/qodana
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}