Skip to content

Commit c87e807

Browse files
adoroszlaimneethiraj
authored andcommitted
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 (cherry picked from commit 6f57f2f)
1 parent f084dc3 commit c87e807

File tree

2 files changed

+31
-29
lines changed

2 files changed

+31
-29
lines changed

.github/workflows/maven.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,36 +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
56+
- name: Upload artifacts
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: target-8
60+
path: target/*
4661

4762
build-11:
63+
needs:
64+
- build-8
4865
runs-on: ubuntu-latest
4966
steps:
5067
- 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-
5177
- name: Set up JDK 11
5278
uses: actions/setup-java@v4
5379
with:
5480
java-version: '11'
5581
distribution: 'temurin'
56-
cache: maven
5782
- name: build (11)
58-
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
5984
- name: Upload artifacts
6085
uses: actions/upload-artifact@v4
6186
with:
@@ -65,7 +90,6 @@ jobs:
6590
docker-build:
6691
needs:
6792
- build-8
68-
- build-11
6993
runs-on: ubuntu-latest
7094
steps:
7195
- uses: actions/checkout@v4
@@ -80,7 +104,7 @@ jobs:
80104
cp version dev-support/ranger-docker/dist
81105
82106
- name: Cache downloaded archives
83-
uses: actions/cache@v3
107+
uses: actions/cache@v4
84108
with:
85109
path: dev-support/ranger-docker/downloads
86110
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
@@ -777,28 +777,6 @@
777777
<url>https://issues.apache.org/jira/browse/ranger</url>
778778
</issueManagement>
779779
<repositories>
780-
<repository>
781-
<releases>
782-
<enabled>false</enabled>
783-
</releases>
784-
<snapshots>
785-
<enabled>true</enabled>
786-
</snapshots>
787-
<id>apache.snapshots.https</id>
788-
<name>Apache Development Snapshot Repository</name>
789-
<url>https://repository.apache.org/content/repositories/snapshots</url>
790-
</repository>
791-
<repository>
792-
<releases>
793-
<enabled>true</enabled>
794-
</releases>
795-
<snapshots>
796-
<enabled>false</enabled>
797-
</snapshots>
798-
<id>apache.public.https</id>
799-
<name>Apache Development Snapshot Repository</name>
800-
<url>https://repository.apache.org/content/repositories/public</url>
801-
</repository>
802780
<repository>
803781
<id>jetbrains-pty4j</id>
804782
<name>jetbrains-intellij-dependencies</name>

0 commit comments

Comments
 (0)