-
Notifications
You must be signed in to change notification settings - Fork 8
146 lines (145 loc) · 4.09 KB
/
build.yaml
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
# This file was generated using Kotlin DSL (.github/workflows/build.main.kts).
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
# Generated with https://github.com/typesafegithub/github-workflows-kt
name: 'Build'
on:
push:
branches:
- 'main'
pull_request: {}
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
check_yaml_consistency:
name: 'Check YAML consistency'
runs-on: 'ubuntu-latest'
steps:
- id: 'step-0'
name: 'Check out'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Execute script'
run: 'rm ''.github/workflows/build.yaml'' && ''.github/workflows/build.main.kts'''
- id: 'step-2'
name: 'Consistency check'
run: 'git diff --exit-code ''.github/workflows/build.yaml'''
build-on-UbuntuLatest:
runs-on: 'ubuntu-latest'
needs:
- 'check_yaml_consistency'
steps:
- id: 'step-0'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Set up Gradle Daemon JDK'
uses: 'actions/setup-java@v4'
with:
java-version: '21'
distribution: 'temurin'
- id: 'step-2'
name: 'Cache Kotlin Konan'
uses: 'actions/cache@v4'
with:
path: '~/.konan/**/*'
key: 'kotlin-konan-${{ runner.os }}'
- id: 'step-3'
name: 'Set up Gradle'
uses: 'gradle/actions/setup-gradle@v4'
with:
gradle-version: 'wrapper'
- id: 'step-4'
name: 'Build'
run: './gradlew build --stacktrace'
build-on-MacOSLatest:
runs-on: 'macos-latest'
needs:
- 'check_yaml_consistency'
steps:
- id: 'step-0'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Set up Gradle Daemon JDK'
uses: 'actions/setup-java@v4'
with:
java-version: '21'
distribution: 'temurin'
- id: 'step-2'
name: 'Cache Kotlin Konan'
uses: 'actions/cache@v4'
with:
path: '~/.konan/**/*'
key: 'kotlin-konan-${{ runner.os }}'
- id: 'step-3'
name: 'Set up Gradle'
uses: 'gradle/actions/setup-gradle@v4'
with:
gradle-version: 'wrapper'
- id: 'step-4'
name: 'Build'
run: './gradlew build --stacktrace'
build-on-WindowsLatest:
runs-on: 'windows-latest'
needs:
- 'check_yaml_consistency'
steps:
- id: 'step-0'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Set up Gradle Daemon JDK'
uses: 'actions/setup-java@v4'
with:
java-version: '21'
distribution: 'temurin'
- id: 'step-2'
name: 'Cache Kotlin Konan'
uses: 'actions/cache@v4'
with:
path: '~/.konan/**/*'
key: 'kotlin-konan-${{ runner.os }}'
- id: 'step-3'
name: 'Set up Gradle'
uses: 'gradle/actions/setup-gradle@v4'
with:
gradle-version: 'wrapper'
- id: 'step-4'
name: 'Build'
run: './gradlew build --stacktrace'
build_kotlin_scripts:
name: 'Build Kotlin scripts'
runs-on: 'ubuntu-latest'
needs:
- 'check_yaml_consistency'
steps:
- id: 'step-0'
uses: 'actions/checkout@v4'
- id: 'step-1'
run: |-
find -name *.main.kts -print0 | while read -d $'\0' file
do
echo "Compiling $file..."
kotlinc -Werror -Xallow-any-scripts-in-source-roots -Xuse-fir-lt=false "$file"
done
workflows_consistency_check:
name: 'Run consistency check on all GitHub workflows'
runs-on: 'ubuntu-latest'
needs:
- 'check_yaml_consistency'
steps:
- id: 'step-0'
uses: 'actions/checkout@v4'
- id: 'step-1'
run: 'cd .github/workflows'
- id: 'step-2'
name: 'Regenerate all workflow YAMLs'
run: |-
find -name "*.main.kts" -print0 | while read -d $'\0' file
do
if [ -x "$file" ]; then
echo "Regenerating $file..."
($file)
fi
done
- id: 'step-3'
name: 'Check if some file is different after regeneration'
run: 'git diff --exit-code .'