-
Notifications
You must be signed in to change notification settings - Fork 52
105 lines (92 loc) · 2.82 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
# Has to be the same name as in build_doc in order to require the same check in GitHub
name: Build
on:
push:
branches:
- 'master'
paths-ignore:
- 'docs/**'
pull_request:
paths-ignore:
- 'docs/**'
jobs:
formatter:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: m273d15/[email protected]
with:
version: '1.6'
build:
runs-on: ubuntu-latest
steps:
# Pre-Build
- uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Determine short sha
id: short-sha
run: |
short_sha=$(git rev-parse --short=10 $GITHUB_SHA)
echo "::set-output name=short_sha::$short_sha"
echo "SHORT_SHA=$short_sha" >> $GITHUB_ENV
shell: 'bash'
# Build
- name: Build and test with Gradle
run: |
./gradlew \
-PskipTestSuites=true \
-PuseBuildScan=true \
-PaggregateTestResults=true \
-PversionQualifier=DEV-$SHORT_SHA \
-DmaxParallelForks=4 \
--no-daemon \
--parallel \
sarosEclipse sarosIntellij sarosServer sarosLsp
# Post-Build
# Success-Case
- name: Upload eclipse build
uses: actions/upload-artifact@v1
if: success() && github.ref == 'refs/heads/master'
with:
name: saros-eclipse-dev-${{ steps.short-sha.outputs.short_sha }}
path: build/distribution/eclipse
- name: Upload intellij build
uses: actions/upload-artifact@v1
if: success() && github.ref == 'refs/heads/master'
with:
name: saros-intellij-dev-${{ steps.short-sha.outputs.short_sha }}
path: build/distribution/intellij
- name: Upload server build
uses: actions/upload-artifact@v1
if: success() && github.ref == 'refs/heads/master'
with:
name: saros-server-dev-${{ steps.short-sha.outputs.short_sha }}
path: build/distribution/server
- name: Upload lsp build
uses: actions/upload-artifact@v1
if: success() && github.ref == 'refs/heads/master'
with:
name: saros-lsp-dev-${{ steps.short-sha.outputs.short_sha }}
path: build/distribution/lsp
# Failure-Case
- name: Check test report
id: check-report
if: failure()
run: |
[ -d 'build/reports/allTests' ] && echo "::set-output name=report-exist::true" || echo "::set-output name=report-exist::false"
shell: 'bash'
- name: Upload test results
uses: actions/upload-artifact@v1
if: failure() && steps.check-report.outputs.report-exist == 'true'
with:
name: test-results-${{ github.sha }}
path: build/reports/allTests