Skip to content

Commit

Permalink
RANGER-5066. Improve CI workflow (#438)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
adoroszlai authored Dec 10, 2024
1 parent c4ea5fd commit 6f57f2f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 29 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,61 @@ name: CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3

jobs:
build-8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache for maven dependencies
uses: actions/cache@v4
with:
path: |
~/.m2/repository/*/*/*
!~/.m2/repository/org/apache/ranger
key: maven-repo-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-repo-
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: build (8)
run: mvn -T 8 clean install --no-transfer-progress -B -V
run: mvn -T 8 clean verify --no-transfer-progress -B -V
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: target-8
path: target/*

build-11:
needs:
- build-8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache for maven dependencies
uses: actions/cache/restore@v4
with:
path: |
~/.m2/repository/*/*/*
!~/.m2/repository/org/apache/ranger
key: maven-repo-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-repo-
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: build (11)
run: mvn -T 8 clean install -pl '!knox-agent' --no-transfer-progress -B -V
run: mvn -T 8 clean verify -pl '!knox-agent' --no-transfer-progress -B -V
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
Expand All @@ -70,7 +90,6 @@ jobs:
docker-build:
needs:
- build-8
- build-11
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -85,7 +104,7 @@ jobs:
cp version dev-support/ranger-docker/dist
- name: Cache downloaded archives
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: dev-support/ranger-docker/downloads
key: ${{ runner.os }}-ranger-downloads-${{ hashFiles('dev-support/ranger-docker/.env') }}
Expand Down
22 changes: 0 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -778,28 +778,6 @@
<url>https://issues.apache.org/jira/browse/ranger</url>
</issueManagement>
<repositories>
<repository>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>apache.snapshots.https</id>
<name>Apache Development Snapshot Repository</name>
<url>https://repository.apache.org/content/repositories/snapshots</url>
</repository>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>apache.public.https</id>
<name>Apache Development Snapshot Repository</name>
<url>https://repository.apache.org/content/repositories/public</url>
</repository>
<repository>
<id>jetbrains-pty4j</id>
<name>jetbrains-intellij-dependencies</name>
Expand Down

0 comments on commit 6f57f2f

Please sign in to comment.