Skip to content

Commit

Permalink
Combine GH action JRE and JDK builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerd Aschemann committed Jan 31, 2023
1 parent 94e52b8 commit 1d706f8
Showing 1 changed file with 5 additions and 50 deletions.
55 changes: 5 additions & 50 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@ jobs:
name: test-results
path: '**/build/test-results/**/TEST-*.xml'

check-jdk-packages:
name: "Check ${{ matrix.product.name }} ${{ matrix.product.version }} ${{ matrix.distro }}"
check-packages:
name: "Check ${{ matrix.image_type }} on ${{ matrix.product.name }} ${{ matrix.product.version }} ${{ matrix.distro }}"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./linux
strategy:
fail-fast: false
matrix:
image_type: [JDK, JRE]
distro: [Alpine, Debian, RedHat, Suse]
product: [
{ name: temurin, version: 8 },
Expand All @@ -76,59 +77,13 @@ jobs:
run: |
export _JAVA_OPTIONS="-Xmx4G"
export DOCKER_BUILDKIT=1
./gradlew --parallel packageJdk${{ matrix.distro }} checkJdk${{ matrix.distro }} -PPRODUCT=${{ matrix.product.name }} -PPRODUCT_VERSION=${{ matrix.product.version }} --stacktrace
./gradlew --parallel package$( echo "${{ matrix.image_type }}" | tr [DKRE] [dkre] )${{ matrix.distro }} check${{ matrix.image_type }}${{ matrix.distro }} -PPRODUCT=${{ matrix.product.name }} -PPRODUCT_VERSION=${{ matrix.product.version }} --stacktrace
- name: Relocate test results
if: always() # always run even if the previous step fails
run: |
mkdir ${{ matrix.product.version }}
mv jdk ${{ matrix.product.version }}
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: always() # always run even if the previous step fails
with:
name: test-results
path: '**/build/test-results/**/TEST-*.xml'

check-jre-packages:
name: "Check ${{ matrix.product.name }} ${{ matrix.product.version }} ${{ matrix.distro }}"
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./linux
strategy:
fail-fast: false
matrix:
distro: [Alpine, Debian, Redhat, Suse]
product: [
{ name: temurin, version: 8 },
{ name: temurin, version: 11 },
{ name: temurin, version: 17 },
{ name: temurin, version: 19 },
]

steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0

- uses: actions/setup-java@1df8dbefe2a8cbc99770194893dd902763bee34b # v3.8.0
with:
java-version: '17'
java-package: jdk
architecture: x64
distribution: 'temurin'

- name: Build # only simulate in Jenkins when select ARCH="all"
run: |
export _JAVA_OPTIONS="-Xmx4G"
export DOCKER_BUILDKIT=1
./gradlew --parallel packageJre${{ matrix.distro }} checkJre${{ matrix.distro }} -PPRODUCT=${{ matrix.product.name }} -PPRODUCT_VERSION=${{ matrix.product.version }} --stacktrace
- name: Relocate test results
if: always() # always run even if the previous step fails
run: |
mkdir ${{ matrix.product.version }}
mv jre ${{ matrix.product.version }}
mv $( echo "${{ matrix.image_type }}" | tr [:upper:] [:lower:] ) ${{ matrix.product.version }}
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: always() # always run even if the previous step fails
Expand Down

0 comments on commit 1d706f8

Please sign in to comment.