-
-
Notifications
You must be signed in to change notification settings - Fork 89
79 lines (77 loc) · 2.31 KB
/
main.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
name: CI
on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
types: [opened, synchronize, ready_for_review]
merge_group:
# Cancel builds if a new commit is pushed, except on master
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
qodana:
name: Qodana
# Note: updating to ubuntu-latest may slow the build and produce a "The runner has received a shutdown signal."
runs-on: ubuntu-20.04
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'zulu'
- name: Generate lexer/parser
run: ./gradlew setupDependencies
- uses: JetBrains/qodana-action@main
name: Qodana
with:
post-pr-comment: false
pr-mode: false
args: >
--baseline,qodana.sarif.json,
--source-directory,src
cache-default-branch-only: true
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
# https://www.jetbrains.com/help/qodana/github.html#GitHub+code+scanning
- name: Upload SARIF report to GitHub
# Also upload report if quality gate fails
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json
test:
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: configure Pagefile
if: matrix.os == 'windows-latest'
uses: al-cheb/[email protected]
with:
minimum-size: 8GB
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'zulu'
- name: Run linting
run: |
chmod +x gradlew
./gradlew ktlintCheck
- name: Run tests
run: ./gradlew check koverXmlReport
- name: Upload coverage report
if: success() && matrix.os == 'ubuntu-latest'
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN}