Skip to content

Commit f0ae622

Browse files
committed
Split workflows [skip ci]
1 parent c19d40a commit f0ae622

File tree

3 files changed

+62
-7
lines changed

3 files changed

+62
-7
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build pull request
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
jobs:
7+
maven-verify:
8+
if: github.event.pull_request.head.repo.fork == true
9+
runs-on: ubuntu-24.04
10+
steps:
11+
- uses: actions/checkout@v5
12+
with:
13+
fetch-depth: 0
14+
- uses: actions/setup-java@v5
15+
with:
16+
java-version: 17.0.13
17+
distribution: liberica
18+
- name: Cache Maven dependencies
19+
uses: actions/cache@v4
20+
with:
21+
path: ~/.m2/repository
22+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
23+
restore-keys: |
24+
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
25+
${{ runner.os }}-maven-
26+
${{ runner.os }}-
27+
- name: Run maven build
28+
run: mvn install -PprettierCheck -Dprettier.nodePath=node -Dprettier.npmPath=npm

.github/workflows/build.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,21 @@ on:
33
pull_request:
44
branches:
55
- master
6+
env:
7+
JFROG_USER: ${{ secrets.ARTIFACTORY_AUTH_USER }}
8+
JFROG_PASS: ${{ secrets.ARTIFACTORY_AUTH_TOKEN }}
9+
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
610
jobs:
7-
maven-verify:
8-
if: github.event.pull_request.head.repo.fork == true
11+
maven-package:
12+
if: github.event.pull_request.head.repo.fork == false
913
runs-on: ubuntu-24.04
1014
steps:
1115
- uses: actions/checkout@v5
1216
with:
1317
fetch-depth: 0
18+
- name: Copy maven settings
19+
run: |
20+
wget https://raw.githubusercontent.com/entur/ror-maven-settings/master/.m2/settings.xml -O .github/workflows/settings.xml
1421
- uses: actions/setup-java@v5
1522
with:
1623
java-version: 17.0.13
@@ -24,5 +31,23 @@ jobs:
2431
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
2532
${{ runner.os }}-maven-
2633
${{ runner.os }}-
34+
2735
- name: Run maven build
28-
run: mvn install -PprettierCheck -Dprettier.nodePath=node -Dprettier.npmPath=npm
36+
run: mvn verify -s .github/workflows/settings.xml -PprettierCheck -Dprettier.nodePath=node -Dprettier.npmPath=npm
37+
- name: Sonar Scan
38+
env:
39+
SONAR_TOKEN: ${{ secrets.ENTUR_SONAR_PASSWORD }}
40+
SONAR_PROJECT_NAME: ${{ github.event.repository.name }}
41+
SONAR_PROJECT_KEY: entur_${{ github.event.repository.name }}
42+
run: |
43+
mvn -Psonar -s .github/workflows/settings.xml \
44+
sonar:sonar \
45+
-Dsonar.projectKey=${SONAR_PROJECT_KEY} \
46+
-Dsonar.organization=enturas-github \
47+
-Dsonar.projectName=${SONAR_PROJECT_NAME} \
48+
-Dsonar.host.url=https://sonarcloud.io \
49+
-Dsonar.token=${SONAR_TOKEN}
50+
- name: Upload artifact
51+
uses: actions/[email protected]
52+
with:
53+
path: gbfs-validator-java/target/*.jar

.github/workflows/deploy.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
name: Build and Deploy Maven Central
2+
3+
concurrency:
4+
group: deploy-master
5+
cancel-in-progress: false
6+
27
on:
38
push:
49
branches:
510
- master
6-
pull_request:
7-
branches:
8-
- master
911
env:
1012
JFROG_USER: ${{ secrets.ARTIFACTORY_AUTH_USER }}
1113
JFROG_PASS: ${{ secrets.ARTIFACTORY_AUTH_TOKEN }}
@@ -16,7 +18,7 @@ env:
1618
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
1719
jobs:
1820
maven-package:
19-
if: github.event.pull_request.head.repo.fork == false && !contains(github.event.head_commit.message, 'ci skip')
21+
if: github.event_name == 'push' && !contains(github.event.head_commit.message, 'ci skip')
2022
runs-on: ubuntu-24.04
2123
steps:
2224
- uses: actions/checkout@v5

0 commit comments

Comments
 (0)