Skip to content

Commit

Permalink
Fixup Build Pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-dejongh committed Sep 22, 2024
1 parent c472525 commit ecdd792
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 12 deletions.
43 changes: 33 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
name: Build
name: Build [PR and non-mainline branches]
on:
pull_request:
branches: main
push:
branches:
- main
- main_**
- features/**
- '!main'
- 'feature/**'

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} # Needed to get PR information, if any
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
ref: ${{ github.head_ref }}

- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 21
distribution: 'temurin'
cache: 'maven'

- name: Branch name
run: echo running on branch ${GITHUB_REF#refs/heads/}
Expand All @@ -30,13 +37,29 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build and Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} # Needed to get PR information, if any
run: mvn clean install

- name: Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=sddevelopment_coding-utils
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=sddevelopment-be_coding-utils

- name: Commit JavaDocs
uses: stefanzweifel/git-auto-commit-action@v5
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} # Needed to get PR information, if any
with:
file_pattern: 'docs/*'
commit_message: 'Update documentation'
disable_globbing: true
48 changes: 48 additions & 0 deletions .github/workflows/build_mainline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build [mainline]
on:
push:
branches:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
pages: write

steps:
- uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} # Needed to get PR information, if any
with:
ref: ${{ github.head_ref }}

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'

- name: Branch name
run: echo running on branch ${GITHUB_REF#refs/heads/}

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build and Test
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} # Needed to get PR information, if any
run: mvn clean install

- name: Analyze
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=sddevelopment-be_coding-utils
Empty file removed .github/workflows/publish.yml
Empty file.
1 change: 0 additions & 1 deletion .github/workflows/rebuildDocs.sh

This file was deleted.

15 changes: 14 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,26 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<version>3.13.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<stylesheet>maven</stylesheet>
<javadocDirectory>src/main/javadoc</javadocDirectory>
<addStylesheets>
<resources>/styles/stylesheet.css</resources>
</addStylesheets>
</configuration>
</plugin>

<plugin>
<groupId>org.projectlombok</groupId>
<artifactId>lombok-maven-plugin</artifactId>
Expand Down

0 comments on commit ecdd792

Please sign in to comment.