Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Extract the setup-java action into a re-usable action #246

Merged
Show file tree
Hide file tree
Changes from 1 commit
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
10 changes: 2 additions & 8 deletions .github/actions/publish-docker-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ inputs:
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/checkout
paullatzelsperger marked this conversation as resolved.
Show resolved Hide resolved

#####################
# Login to DockerHub
Expand All @@ -56,12 +55,7 @@ runs:
#####################
# Build JAR file
#####################
- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- uses: ./.github/actions/setup-java
- name: Build Controlplane
shell: bash
run: |-
Expand Down
10 changes: 2 additions & 8 deletions .github/actions/run-deployment-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,15 @@ inputs:
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/[email protected]
- uses: ./.github/actions/checkout

- name: Cache ContainerD Image Layers
uses: actions/cache@v3
with:
path: /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs
key: ${{ runner.os }}-io.containerd.snapshotter.v1.overlayfs

- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- uses: ./.github/actions/setup-java

- name: Build docker images
shell: bash
Expand Down
26 changes: 6 additions & 20 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,8 @@ jobs:
needs: [ secret-presence ]
steps:
# Set-Up
- name: Checkout
uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- uses: ./.github/actions/checkout
- uses: ./.github/actions/setup-java
paullatzelsperger marked this conversation as resolved.
Show resolved Hide resolved
# Build
- name: Build Extensions
run: |-
Expand All @@ -104,8 +98,7 @@ jobs:
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/checkout
- uses: ./.github/actions/publish-docker-image
with:
rootDir: edc-controlplane/${{ matrix.name }}
Expand All @@ -128,8 +121,7 @@ jobs:
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/checkout
- uses: ./.github/actions/publish-docker-image
with:
rootDir: edc-dataplane/${{ matrix.name }}
Expand All @@ -149,15 +141,9 @@ jobs:
needs.secret-presence.outputs.GPG_PASSPHRASE && needs.secret-presence.outputs.GPG_PRIVATE_KEY && github.event_name != 'pull_request' && github.ref != 'refs/heads/releases'
steps:
# Set-Up
- name: Checkout
uses: actions/[email protected]
- uses: ./.github/actions/checkout

- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- uses: ./.github/actions/setup-java
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v5
with:
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/business-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,9 @@ jobs:
### Set-Up ###
##############
-
name: Checkout
uses: actions/[email protected]
uses: ./.github/actions/checkout
-
name: Set-Up JDK 11
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
uses: ./.github/actions/setup-java
-
name: Cache ContainerD Image Layers
uses: actions/cache@v3
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/deployment-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ jobs:
deployment-test-memory:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- uses: ./.github/actions/checkout
- uses: ./.github/actions/run-deployment-test
name: "Run deployment test using KinD and Helm"
with:
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/draft-new-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
pages: write
pull-requests: write
steps:
- uses: actions/checkout@v3.3.0
- uses: ./.github/actions/checkout
-
name: Create release branch
run: git checkout -b release/${{ github.event.inputs.version }}
Expand All @@ -33,12 +33,7 @@ jobs:
git config user.name "GitHub actions"
git config user.email [email protected]
-
name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
uses: ./.github/actions/setup-java
-
name: Bump version in gradle.properties
run: |-
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/helm-chart-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ jobs:

steps:
# fetch-depth: 0 is required to determine differences in chart(s)
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/checkout
with:
fetch-depth: 0

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/helm-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ jobs:
### Set-Up ###
##############
-
name: Checkout
uses: actions/[email protected]
uses: ./.github/actions/checkout
with:
fetch-depth: 0
-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
security-events: write

steps:
- uses: actions/checkout@v3.3.0
- uses: ./.github/actions/checkout

- name: KICS scan
uses: checkmarx/[email protected]
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ jobs:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/checkout
- uses: ./.github/actions/publish-docker-image
with:
rootDir: edc-controlplane/${{ matrix.name }}
Expand All @@ -74,8 +73,7 @@ jobs:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: ./.github/actions/checkout
- uses: ./.github/actions/publish-docker-image
with:
rootDir: edc-dataplane/${{ matrix.name }}
Expand Down
23 changes: 5 additions & 18 deletions .github/workflows/publish-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,9 @@ jobs:
run: |
echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/[email protected]
uses: ./.github/actions/checkout
-
name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
uses: ./.github/actions/setup-java

- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v5
Expand Down Expand Up @@ -96,8 +90,7 @@ jobs:
run: |
echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/[email protected]
uses: ./.github/actions/checkout
with:
fetch-depth: 0
-
Expand Down Expand Up @@ -144,8 +137,7 @@ jobs:
run: |
echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV
-
name: Checkout
uses: actions/[email protected]
uses: ./.github/actions/checkout
with:
# 0 to fetch the full history due to upcoming merge of releases into main branch
fetch-depth: 0
Expand Down Expand Up @@ -177,12 +169,7 @@ jobs:
draft: false
prerelease: false
-
name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
uses: ./.github/actions/setup-java
-
name: Merge releases back into main and set new snapshot version
if: github.event.pull_request.base.ref == 'releases'
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ jobs:
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/[email protected]
- uses: ./.github/actions/checkout
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
Expand Down Expand Up @@ -72,8 +71,7 @@ jobs:
- edc-dataplane-azure-vault
- edc-dataplane-hashicorp-vault
steps:
- name: Checkout
uses: actions/[email protected]
- uses: ./.github/actions/checkout
- name: Run Trivy vulnerability scanner
if: always()
uses: aquasecurity/trivy-action@master
Expand Down
30 changes: 6 additions & 24 deletions .github/workflows/veracode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,10 @@ jobs:
verify-formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- uses: ./.github/actions/checkout
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- uses: ./.github/actions/setup-java
- name: Verify proper formatting
run: ./gradlew spotlessCheck

Expand All @@ -51,14 +45,8 @@ jobs:
- edc-controlplane-postgresql-hashicorp-vault
steps:
# Set-Up
- name: Checkout
uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- uses: ./.github/actions/checkout
- uses: ./.github/actions/setup-java
# Build
- name: Build Controlplane
run: |-
Expand Down Expand Up @@ -95,14 +83,8 @@ jobs:
- edc-dataplane-hashicorp-vault
steps:
# Set-Up
- name: Checkout
uses: actions/[email protected]
- name: Set up JDK 11
uses: actions/[email protected]
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- uses: ./.github/actions/checkout
- uses: ./.github/actions/setup-java
# Build
- name: Build Dataplane
run: |-
Expand Down
Loading