Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 0 additions & 164 deletions .github/workflows/build.yml

This file was deleted.

18 changes: 12 additions & 6 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ name: "Code Style"

on:
push:
branches:
- develop
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

checkstyle:
Expand All @@ -16,10 +22,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
Expand All @@ -43,10 +49,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
Expand All @@ -70,10 +76,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish to Docker Hub

on:
push:
branches:
- develop
pull_request:
release:
types:
- created

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
verify:
uses: FAIRDataTeam/github-workflows/.github/workflows/maven-verify.yml@v2
with:
java-version: 17
# todo: enable tests when test duration has been minimized
mvn-options: "-DskipTests"
publish:
needs: verify
uses: FAIRDataTeam/github-workflows/.github/workflows/docker-publish.yml@v2
secrets: inherit
with:
file: './Dockerfile'
push: ${{ github.event_name == 'push' || github.event_name == 'release' }}
36 changes: 36 additions & 0 deletions .github/workflows/maven-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven

name: Maven verify

on:
push:
branches:
- develop
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
strategy:
matrix:
runner:
# https://github.com/ankane/setup-mongodb?tab=readme-ov-file#versions
- os: ubuntu-24.04
mongo: 8
- os: windows-2022
mongo: 5
- os: macos-14
mongo: 8
java-version:
- 17
uses: FAIRDataTeam/github-workflows/.github/workflows/maven-verify.yml@v2
with:
runner: ${{ matrix.runner.os }}
java-version: ${{ matrix.java-version }}
# db settings must match testing profile
db-type: mongodb
db-version: ${{ matrix.runner.mongo }} # see https://github.com/ankane/setup-mongodb/issues/6
22 changes: 13 additions & 9 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ name: "Security Audit"

on:
push:
branches: [ develop, master ]
branches:
- develop
pull_request:
branches: [ develop ]
schedule:
- cron: '23 4 * * 1'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
codeql:
name: CodeQL
Expand All @@ -23,10 +27,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
Expand All @@ -37,7 +41,7 @@ jobs:
mvn --version

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: 'java'

Expand All @@ -46,7 +50,7 @@ jobs:
mvn --quiet -B -U --fail-fast -DskipTests package

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3

snyk:
name: Snyk (Maven)
Expand All @@ -59,7 +63,7 @@ jobs:
steps:

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Perform Snyk Check (Maven)
uses: snyk/actions/maven@master
Expand All @@ -83,12 +87,12 @@ jobs:
steps:

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Docker build
run: |
docker pull $PUBLIC_IMAGE:$TAG_DEVELOP
docker build --cache-from $PUBLIC_IMAGE:$TAG_DEVELOP -t fdp:snyk-test -f Dockerfile.build .
docker build --cache-from $PUBLIC_IMAGE:$TAG_DEVELOP -t fdp:snyk-test -f Dockerfile .

- name: Perform Snyk Check (Docker)
uses: snyk/actions/docker@master
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Changed

- Cleaned up Dockerfile (backport)
- Separate Github workflows for test and publish (backport)

## [1.17.2]

Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
################################################################################
# BUILD JAR

FROM maven:3-eclipse-temurin-17-alpine AS builder
FROM maven:3-eclipse-temurin-17-focal AS builder

WORKDIR /builder

Expand All @@ -16,11 +16,12 @@ RUN mvn --quiet --batch-mode --update-snapshots --fail-fast -DskipTests package
################################################################################
# BUILD IMAGE

FROM eclipse-temurin:17-jdk-alpine
FROM eclipse-temurin:17-jdk-focal

# add non-root user to run the app
# https://spring.io/guides/gs/spring-boot-docker
RUN addgroup -S spring && adduser -S spring -G spring
# on ubuntu the following creates a group with the same name as user
RUN adduser spring --system --group
USER spring:spring

WORKDIR /fdp
Expand Down
Loading