-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (71 loc) · 2.44 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
name: MPS-logical-view-checks_CI
on:
push:
branches:
- main
- 'maintenance/*'
pull_request:
workflow_dispatch:
inputs:
publish:
description: Whether to publish the build result to Maven repositories
type: boolean
default: false
required: false
env:
GITHUB_TOKEN: ${{ secrets.MPS_CI_BUILD_BOT_ACCESS_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build mps-logical-view-checks and migrate
run: |
xvfb-run ./gradlew build migrate remigrate \
-Partifacts.itemis.cloud.user=${{secrets.ARTIFACTS_ITEMIS_CLOUD_USER}} \
-Partifacts.itemis.cloud.pw=${{secrets.ARTIFACTS_ITEMIS_CLOUD_PW}}
- name: Dump Java stacks on cancellation
if: cancelled()
run: |
jps -mlv > build/jps.txt
for pid in $(jps -q); do jstack -l -e $pid > build/stack$pid.txt || true; done
- name: Upload logs on cancellation or failure
uses: actions/upload-artifact@v4
if: cancelled() || failure()
with:
name: logs
path: |
build/system/log/
build/system/testlog/
build/jps.txt
build/stack*.txt
- name: Check for no dirty files after build and migration
run: |
if [[ -n $(git status --porcelain | head --lines=1) ]]
then
echo "Dirty files detected after build/migration, run './gradlew build migrate remigrate' and/or update .gitignore to fix:"
git status
echo ">>>>>>>>>>>>>>>>>>>>>"
git diff
echo "<<<<<<<<<<<<<<<<<<<<<"
exit 1
fi
- name: Publish
# Only publish on push (to maintenance or main) or when explicitly requested
if: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.publish == 'true') }}
run: |
./gradlew publish -x build \
-Partifacts.itemis.cloud.user=${{secrets.ARTIFACTS_ITEMIS_CLOUD_USER}} \
-Partifacts.itemis.cloud.pw=${{secrets.ARTIFACTS_ITEMIS_CLOUD_PW}}
- name: Archive distribution
uses: actions/upload-artifact@v4
with:
name: com.mbeddr.logicalview.checks
path: build/artifacts/com.mbeddr.logicalview.checks/