-
Notifications
You must be signed in to change notification settings - Fork 20
194 lines (167 loc) · 7.57 KB
/
xvm-verify-push.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#
# GitHub runner workflow for building, verifying and testing the XVM repo.
#
# TODO: Add periodic workflows (that can be manually triggered /w workflow_disspatch and also run through a cron file)
# 1) Cleans out old workflows that have finished but not succeeded.
# 2) Cleans Gradle and other build caches, maybe one every 24 h
# 3) Cleans ...
#
# Check if "pull-request" makes it possible to add a branch protection status check requirement on master.
# gh auth switch --hostname enterprise.internal --user monalisa (switch auth)
name: XVM Verification and Package Updates
on:
push:
workflow_dispatch:
inputs:
extra_gradle_options:
description: 'Extra Gradle options to pass to the build'
required: false
skip_manual_tests:
description: 'Skip manual tests'
required: false
skip_manual_tests_parallel:
description: 'Skip parallel manual tests'
required: false
env:
# TODO: Default should be disabled; we only want to be bothered by tagging and publishing for the master branch.
always_publish_snapshot: false
enable_gradle_home_cache_cleanup: true
# Add manual tests as an included build to the composite build configuration, and also build them.
ORG_GRADLE_PROJECT_includeBuildManualTests: true
ORG_GRADLE_PROJECT_includeBuildAttachManualTests: true
ORG_GRADLE_PROJECT_xtcPluginOverrideVerboseLogging: true
# Add sanity checks that the javatools fatjar contains appropriate classes and dependencies
ORG_XTCLANG_JAVATOOLS_SANITY_CHECK_JAR: true
# Secrets (TODO: Verify plugin portal and maven central/sonatype credentials)
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GRADLE_PUBLISH_KEY: ${{ secrets.ORG_XTCLANG_GRADLE_PLUGIN_PORTAL_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.ORG_XTCLANG_GRADLE_PLUGIN_PORTAL_PUBLISH_SECRET }}
GPG_SIGNING_KEY: ${{ secrets.ORG_XTCLANG_GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.ORG_XTCLANG_GPG_SIGNING_PASSWORD }}
MAVEN_CENTRAL_USERNAME: ${{ secrets.ORG_XTCLANG_MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_PASSWORD: ${{ secrets.ORG_XTCLANG_MAVEN_CENTRAL_PASSWORD }}
gradle_options: "-Dorg.gradle.jvmargs=-Xmx8G -Dorg.gradle.caching.debug=false -Dorg.gradle.vfs.verbose=false --stacktrace --warning-mode=all --console=plain ${{ inputs.extra_gradle_options }}"
# Optional flags to skip manual tests, or at least some of them.
skip_manual_tests: ${{ github.event.inputs.skip_manual_tests || 'false' }}
skip_manual_tests_parallel: ${{ github.event.inputs.skip_manual_tests_parallel || 'false' }}
# Build environment and build workflow debug flags.
# ACTIONS_RUNNER_DEBUG: true
# ACTIONS_STEP_DEBUG: true
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
# Concurrency settings: group by workflow and ref, cancel intermediate builds, but only if it's a pull request build.
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
build-verify:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Fetch Sources
uses: actions/checkout@v4
with:
show-progress: true
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: ${{ env.enable_gradle_home_cache_cleanup }}
cache-disabled: ${{ github.ref == 'refs/heads/master' }}
cache-read-only: false
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Dump environment info
shell: bash
run: |
echo "*** Branch (github.ref) : ${{ github.ref }}"
echo "*** Commit (github.sha) : ${{ github.sha }}"
echo "*** Runner OS : ${{ runner.os }}"
echo "*** Java system properties :"
java -XshowSettings:properties --version
- name: Build the XDK and create a distribution layout
shell: bash
run: |
cwd_path=$(pwd)
echo "Executing Gradle 'installDist' task from path: '$cwd_path'"
./gradlew ${{ env.gradle_options }} installDist
- name: Build a machine specific XDK installation with native launchers, test run launchers on native platform
shell: bash
run: |
./gradlew ${{ env.gradle_options }} xdk:installWithLaunchersDist
xcc_path=$(find xdk/build/install/ -name xcc)
xec_path=$(find xdk/build/install/ -name xec)
echo "Location of native launcher (xcc): $xcc_path"
echo "Location of native launcher (xec): $xec_path"
echo "*** Testing native launchers, verifying their binary format and that they run on this platform..."
xcc_file=$(file $xcc_path)
xec_file=$(file $xec_path)
xcc_version=$($xcc_path --version)
xec_version=$($xec_path --version)
echo " xcc:"
echo " file : $xcc_file"
echo " version: $xcc_version"
echo " xec:"
echo " file : $xec_file"
echo " version: $xec_version"
echo "*** Native launchers work."
- name: Default manualTest tasks
if: ${{ env.skip_manual_tests != 'true' }}
timeout-minutes: 5
shell: bash
run: |
./gradlew ${{ env.gradle_options }} manualTests:runXtc
./gradlew ${{ env.gradle_options }} manualTests:runOne -PtestName=TestMisc
./gradlew ${{ env.gradle_options }} manualTests:runTwoTestsInSequence
echo "*** manualTests:runParallel: ${{ env.skip_manual_tests_parallel }}"
- name: Parallel manualTest task
timeout-minutes: 5
if: ${{ env.skip_manual_tests_parallel != 'true' }}
shell: bash
run: |
./gradlew ${{ env.gradle_options }} manualTests:runParallel
publish-snapshot:
name: Publish to GitHub packages iff snapshot + non-redundant build platform + branch is master
needs: build-verify
runs-on: ubuntu-latest
#if: ${{ (github.ref == 'refs/heads/master') }}
steps:
- name: Maximize Build Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
large-packages: false
# Check out current repository
- name: Fetch Sources
uses: actions/checkout@v4
# Set up Java environment for the next steps
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: ${{ env.enable_gradle_home_cache_cleanup }}
cache-disabled: ${{ github.ref == 'refs/heads/master' }}
cache-read-only: false
- name: Dump environment info
shell: bash
run: |
echo "*** Branch (github.ref) : ${{ github.ref }}"
echo "*** Commit (github.sha) : ${{ github.sha }}"
echo "*** Runner OS : ${{ runner.os }}"
echo "*** Java system properties :"
java -XshowSettings:properties --version
- name: Create or Update Snapshot (if pushed to 'master', or env.always_publish_snapshot is true)
if: ${{ (env.always_publish_snapshot == 'true') || (github.ref == 'refs/heads/master') }}
shell: bash
run: |
./gradlew ${{ env.gradle_options }} xdk:ensureTags -PsnapshotOnly=true
./gradlew ${{ env.gradle_options }} publishRemote -PsnapshotOnly=true