Skip to content

Commit 6f57f2f

Browse files
authored
RANGER-5066. Improve CI workflow (#438)
Changes include: - using actions/cache v4 - remove apache repos (let them be inherited) - add MAVEN_OPTS with http retry - build `build-11` only after `build-8` and initiate `docker-build` after `build-8` succeeds - Run the workflow on push for any branch
1 parent c4ea5fd commit 6f57f2f

File tree

2 files changed

+26
-29
lines changed

2 files changed

+26
-29
lines changed

.github/workflows/maven.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,41 +26,61 @@ name: CI
2626

2727
on:
2828
push:
29-
branches: [ "master" ]
3029
pull_request:
3130
branches: [ "master" ]
3231

32+
env:
33+
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
34+
3335
jobs:
3436
build-8:
3537
runs-on: ubuntu-latest
3638
steps:
3739
- uses: actions/checkout@v4
40+
- name: Cache for maven dependencies
41+
uses: actions/cache@v4
42+
with:
43+
path: |
44+
~/.m2/repository/*/*/*
45+
!~/.m2/repository/org/apache/ranger
46+
key: maven-repo-${{ hashFiles('**/pom.xml') }}
47+
restore-keys: |
48+
maven-repo-
3849
- name: Set up JDK 8
3950
uses: actions/setup-java@v4
4051
with:
4152
java-version: '8'
4253
distribution: 'temurin'
43-
cache: maven
4454
- name: build (8)
45-
run: mvn -T 8 clean install --no-transfer-progress -B -V
55+
run: mvn -T 8 clean verify --no-transfer-progress -B -V
4656
- name: Upload artifacts
4757
uses: actions/upload-artifact@v4
4858
with:
4959
name: target-8
5060
path: target/*
5161

5262
build-11:
63+
needs:
64+
- build-8
5365
runs-on: ubuntu-latest
5466
steps:
5567
- uses: actions/checkout@v4
68+
- name: Cache for maven dependencies
69+
uses: actions/cache/restore@v4
70+
with:
71+
path: |
72+
~/.m2/repository/*/*/*
73+
!~/.m2/repository/org/apache/ranger
74+
key: maven-repo-${{ hashFiles('**/pom.xml') }}
75+
restore-keys: |
76+
maven-repo-
5677
- name: Set up JDK 11
5778
uses: actions/setup-java@v4
5879
with:
5980
java-version: '11'
6081
distribution: 'temurin'
61-
cache: maven
6282
- name: build (11)
63-
run: mvn -T 8 clean install -pl '!knox-agent' --no-transfer-progress -B -V
83+
run: mvn -T 8 clean verify -pl '!knox-agent' --no-transfer-progress -B -V
6484
- name: Upload artifacts
6585
uses: actions/upload-artifact@v4
6686
with:
@@ -70,7 +90,6 @@ jobs:
7090
docker-build:
7191
needs:
7292
- build-8
73-
- build-11
7493
runs-on: ubuntu-latest
7594
steps:
7695
- uses: actions/checkout@v4
@@ -85,7 +104,7 @@ jobs:
85104
cp version dev-support/ranger-docker/dist
86105
87106
- name: Cache downloaded archives
88-
uses: actions/cache@v3
107+
uses: actions/cache@v4
89108
with:
90109
path: dev-support/ranger-docker/downloads
91110
key: ${{ runner.os }}-ranger-downloads-${{ hashFiles('dev-support/ranger-docker/.env') }}

pom.xml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -778,28 +778,6 @@
778778
<url>https://issues.apache.org/jira/browse/ranger</url>
779779
</issueManagement>
780780
<repositories>
781-
<repository>
782-
<releases>
783-
<enabled>false</enabled>
784-
</releases>
785-
<snapshots>
786-
<enabled>true</enabled>
787-
</snapshots>
788-
<id>apache.snapshots.https</id>
789-
<name>Apache Development Snapshot Repository</name>
790-
<url>https://repository.apache.org/content/repositories/snapshots</url>
791-
</repository>
792-
<repository>
793-
<releases>
794-
<enabled>true</enabled>
795-
</releases>
796-
<snapshots>
797-
<enabled>false</enabled>
798-
</snapshots>
799-
<id>apache.public.https</id>
800-
<name>Apache Development Snapshot Repository</name>
801-
<url>https://repository.apache.org/content/repositories/public</url>
802-
</repository>
803781
<repository>
804782
<id>jetbrains-pty4j</id>
805783
<name>jetbrains-intellij-dependencies</name>

0 commit comments

Comments
 (0)