forked from eclipse-tractusx/tractusx-edc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Extract the setup-java action into a re-usable action (ecli…
…pse-tractusx#246) * Extract the checkout and setup-java action into a re-usable action * Commit actions. * fix action * remove checkout extraction
- Loading branch information
1 parent
f6b877c
commit baa621a
Showing
14 changed files
with
71 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,8 +41,7 @@ inputs: | |
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/[email protected] | ||
|
||
##################### | ||
# Login to DockerHub | ||
|
@@ -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: |- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,21 +42,15 @@ inputs: | |
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
|
||
- 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# | ||
# Copyright (c) 2023 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) | ||
# Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
# | ||
# See the NOTICE file(s) distributed with this work for additional | ||
# information regarding copyright ownership. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Apache License, Version 2.0 which is available at | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
--- | ||
name: "Setup JDK 17" | ||
description: "Setup JDK 17" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: 'gradle' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: actions/[email protected] | ||
- uses: ./.github/actions/setup-java | ||
# Build | ||
- name: Build Extensions | ||
run: |- | ||
|
@@ -104,8 +98,7 @@ jobs: | |
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/publish-docker-image | ||
with: | ||
rootDir: edc-controlplane/${{ matrix.name }} | ||
|
@@ -128,8 +121,7 @@ jobs: | |
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/publish-docker-image | ||
with: | ||
rootDir: edc-dataplane/${{ matrix.name }} | ||
|
@@ -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: actions/[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: Import GPG Key | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,15 +50,9 @@ jobs: | |
### 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/setup-java | ||
- | ||
name: Cache ContainerD Image Layers | ||
uses: actions/cache@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,8 +47,7 @@ jobs: | |
deployment-test-memory: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/run-deployment-test | ||
name: "Run deployment test using KinD and Helm" | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: |- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,8 +38,7 @@ jobs: | |
|
||
steps: | ||
# fetch-depth: 0 is required to determine differences in chart(s) | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,6 @@ jobs: | |
### Set-Up ### | ||
############## | ||
- | ||
name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,8 +50,7 @@ jobs: | |
contents: write | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/publish-docker-image | ||
with: | ||
rootDir: edc-controlplane/${{ matrix.name }} | ||
|
@@ -74,8 +73,7 @@ jobs: | |
contents: write | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/[email protected] | ||
- uses: ./.github/actions/publish-docker-image | ||
with: | ||
rootDir: edc-dataplane/${{ matrix.name }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,15 +54,9 @@ jobs: | |
run: | | ||
echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV | ||
- | ||
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/setup-java | ||
|
||
- name: Import GPG Key | ||
uses: crazy-max/ghaction-import-gpg@v5 | ||
|
@@ -96,7 +90,6 @@ jobs: | |
run: | | ||
echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV | ||
- | ||
name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
@@ -144,7 +137,6 @@ jobs: | |
run: | | ||
echo "RELEASE_VERSION=${{ needs.release-version.outputs.RELEASE_VERSION }}" >> $GITHUB_ENV | ||
- | ||
name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
# 0 to fetch the full history due to upcoming merge of releases into main branch | ||
|
@@ -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' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,8 +36,7 @@ jobs: | |
contents: read | ||
security-events: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
- name: Run Trivy vulnerability scanner in repo mode | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
|
@@ -72,8 +71,7 @@ jobs: | |
- edc-dataplane-azure-vault | ||
- edc-dataplane-hashicorp-vault | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
|
||
## This step will fail if the docker images is not found | ||
- name: "Check if image exists" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,16 +23,10 @@ jobs: | |
verify-formatting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
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 | ||
|
||
|
@@ -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: actions/[email protected] | ||
- uses: ./.github/actions/setup-java | ||
# Build | ||
- name: Build Controlplane | ||
run: |- | ||
|
@@ -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: actions/[email protected] | ||
- uses: ./.github/actions/setup-java | ||
# Build | ||
- name: Build Dataplane | ||
run: |- | ||
|
Oops, something went wrong.