-
Notifications
You must be signed in to change notification settings - Fork 1
167 lines (142 loc) · 4.74 KB
/
Build.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: build
on:
pull_request:
paths-ignore:
- '**/*.md'
push:
branches:
- 'main'
paths-ignore:
- '**/*.md'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
CI: true
TERM: dumb
GRADLE_OPTS: >-
-Dorg.gradle.jvmargs="-Xmx3G -XX:MaxMetaspaceSize=1G -XX:SoftRefLRUPolicyMSPerMB=10 -XX:+UseParallelGC"
-Dorg.gradle.dependency.verification.console=verbose
KOTLIN_DAEMON_JVMARGS: >-
-Xmx1G -XX:MaxMetaspaceSize=320M -XX:SoftRefLRUPolicyMSPerMB=10 -XX:+UseParallelGC -XX:NewRatio=1
ORG_GRADLE_PROJECT_verboseTest: true
permissions:
checks: write
pull-requests: write
jobs:
assemble:
name: Assemble, run tests
runs-on: ubuntu-latest
timeout-minutes: 60
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install WABT
run: |
curl -fsSL https://github.com/WebAssembly/wabt/releases/download/1.0.34/wabt-1.0.34-ubuntu.tar.gz | \
tar -C $HOME -xzf -
echo "$HOME/wabt-1.0.34/bin" >> $GITHUB_PATH
- name: Install EMSDK
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.55
actions-cache-folder: 'emsdk-cache'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-encryption-key: ${{ secrets.GradleEncryptionKey }}
dependency-graph: generate
- name: Restore Kotlin Native Cache
uses: actions/cache/restore@v4
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts', 'buildSrc') }}
restore-keys: ${{ runner.os }}-konan-
- name: Assemble debug build, run tests
run: >
./gradlew -Pkotlin.daemon.jvmargs="${{ env.KOTLIN_DAEMON_JVMARGS }}"
build --stacktrace --scan
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ !cancelled() && (github.actor != 'dependabot[bot]') }}
with:
comment_mode: off
junit_files: '**/build/test-results/**/*.xml'
check_name: "Test results"
- name: Bundle the test reports
if: failure()
run: >
find . \(
-name .idea -o -path '*build/intermediates' -o -path '*build/.transforms' -o -path '*build/generated'
\) -prune -o
-type d -name 'reports' -print0
| xargs -0 tar -c -I 'zstd -19 -T0' -f test-reports.tar.zst
- name: Upload test reports
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-reports
path: test-reports.tar.zst
- name: Save Kotlin Native Cache
uses: actions/cache/save@v4
if: github.ref_name == 'main'
with:
path: ~/.konan
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts', 'buildSrc') }}
static-analysis:
name: Style check
runs-on: ubuntu-latest
permissions:
security-events: write
timeout-minutes: 60
if: >-
!contains(github.event.head_commit.message, '[ci skip]')
&& github.actor != 'dependabot[bot]'
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
cache-encryption-key: ${{ secrets.GradleEncryptionKey }}
dependency-graph: generate
- name: Run static code analyzers
run: >
./gradlew -Pkotlin.daemon.jvmargs="${{ env.KOTLIN_DAEMON_JVMARGS }}"
styleCheck --continue
- name: Uploads Detekt .sarif files to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ./build/reports/detekt/report.sarif
category: detekt
- name: Uploads Diktat .sarif files to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ./build/reports/diktat/diktat.sarif
category: diktat
- name: Bundle the build report
if: ${{ !cancelled() }}
run: >
tar -c -I 'zstd -19 -T0' -f lint-outputs.tar.zst build/reports
- name: Upload lint outputs
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: lint-outputs
path: lint-outputs.tar.zst