-
-
Notifications
You must be signed in to change notification settings - Fork 302
129 lines (121 loc) · 4.07 KB
/
rebuild.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
name: 'Rebuild'
on:
push:
branches-ignore:
- 'dependabot/**'
paths:
- '**'
- '!docs/**'
- '!.github/**'
- '.github/**/*rebuild*'
pull_request:
paths:
- '**'
- '!docs/**'
- '!.github/**'
- '.github/**/*rebuild*'
env:
LC_ALL: en_US.UTF-8
GRADLE_OPTS: >-
-Dorg.gradle.parallel=true
MAVEN_OPTS: >-
-Dhttp.keepAlive=false
-Dmaven.wagon.http.pool=false
-Dmaven.wagon.http.retryHandler.count=3
-Daether.connector.http.retryHandler.count=5
-Daether.connector.http.reuseConnections=false
-Daether.connector.http.connectionMaxTtl=25
-Daether.connector.connectTimeout=120000
BNDTOOLS_CORE_TEST_NOJUNITOSGI: true # This test is very flaky on CI
defaults:
run:
shell: bash
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: ${{ (github.repository != 'bndtools/bnd') || ((github.ref != 'refs/heads/master') && (github.ref != 'refs/heads/next')) || (github.event_name == 'pull_request') }}
matrix:
os:
- 'ubuntu-latest'
java:
- '17'
name: Build JDK${{ matrix.java }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
outputs:
dist-bundles: Dist_Bundles_JDK${{ matrix.java }}_${{ matrix.os }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Git Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Set up Java ${{ matrix.java }}
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
distribution: 'temurin'
java-version: |
8
${{ matrix.java }}
- name: Set up Gradle
uses: gradle/gradle-build-action@b5126f31dbc19dd434c3269bf8c28c315e121da2
- name: Build
id: build
run: |
./.github/scripts/rebuild-build.sh
- name: Upload dist/bundles
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: Dist_Bundles_JDK${{ matrix.java }}_${{ matrix.os }}
if-no-files-found: error
path: dist/bundles/
rebuild:
needs: build
strategy:
fail-fast: ${{ (github.repository != 'bndtools/bnd') || ((github.ref != 'refs/heads/master') && (github.ref != 'refs/heads/next')) || (github.event_name == 'pull_request') }}
matrix:
os:
- 'ubuntu-latest'
java:
- '17'
- '20'
runner:
- '{0}' # 'xvfb-run --auto-servernum {0}'
name: Rebuild JDK${{ matrix.java }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Git Checkout
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Set up Java 8 + ${{ matrix.java }}
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
distribution: 'temurin'
java-version: |
8
${{ matrix.java }}
- name: Set up Gradle
uses: gradle/gradle-build-action@b5126f31dbc19dd434c3269bf8c28c315e121da2
- name: Download dist/bundles
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
name: ${{ needs.build.outputs.dist-bundles }}
path: dist/bundles
- name: Rebuild
id: build
run: |
${{ format(matrix.runner, './.github/scripts/rebuild-test.sh') }}
- name: Upload Test Reports
if: ${{ always() && ((steps.build.outcome == 'success') || (steps.build.outcome == 'failure')) }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
name: Rebuild_JDK${{ matrix.java }}_${{ matrix.os }}-test-reports
path: |
*/generated/test-reports/*/TEST-*.xml
maven/*/target/surefire-reports/TEST-*.xml
gradle-plugins/*/build/test-results/*/TEST-*.xml