From 2aad9094042c883f0032d58edec45e3c22822baf Mon Sep 17 00:00:00 2001 From: christian <153755613+skateball@users.noreply.github.com> Date: Thu, 10 Oct 2024 14:24:02 +0200 Subject: [PATCH] Create e2e-versions-sapmachine.yml --- .github/workflows/e2e-versions-sapmachine.yml | 283 ++++++++++++++++++ 1 file changed, 283 insertions(+) create mode 100644 .github/workflows/e2e-versions-sapmachine.yml diff --git a/.github/workflows/e2e-versions-sapmachine.yml b/.github/workflows/e2e-versions-sapmachine.yml new file mode 100644 index 000000000..962274e0f --- /dev/null +++ b/.github/workflows/e2e-versions-sapmachine.yml @@ -0,0 +1,283 @@ +name: Validate Java e2e + +on: + push: + branches: + - main + - releases/* + paths-ignore: + - '**.md' + pull_request: + paths-ignore: + - '**.md' + schedule: + - cron: '0 */12 * * *' + workflow_dispatch: +jobs: + setup-java-major-versions: + name: 1mv ${{ matrix.distribution }} ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-13, windows-latest, ubuntu-latest] + distribution: [ 'sapmachine' ] # internally 'adopt-hotspot' is the same as 'adopt' + version: ['21', '11', '17'] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: setup-java + uses: ./ + id: setup-java + with: + java-version: ${{ matrix.version }} + distribution: ${{ matrix.distribution }} + - name: Verify Java + run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" + shell: bash + + setup-java-major-minor-versions: + name: 2mmv ${{ matrix.distribution }} ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }} + needs: setup-java-major-versions + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + distribution: ['sapmachine'] + version: + - '11.0.24' + - '21.0.4' + - '17.0.12' + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: setup-java + uses: ./ + id: setup-java + with: + java-version: ${{ matrix.version }} + distribution: ${{ matrix.distribution }} + - name: Verify Java + run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" + shell: bash + + setup-java-check-latest: + name: 3cl ${{ matrix.distribution }} ${{ matrix.version }} - check-latest flag - ${{ matrix.os }} + needs: setup-java-major-versions + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + distribution: ['sapmachine'] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: setup-java + uses: ./ + id: setup-java + with: + distribution: ${{ matrix.distribution }} + java-version: 11 + check-latest: true + - name: Verify Java + run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}" + shell: bash + + setup-java-multiple-jdks: + name: 4mj ${{ matrix.distribution }} ${{ matrix.version }} - multiple jdks - ${{ matrix.os }} + needs: setup-java-major-versions + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + distribution: ['sapmachine'] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: setup-java + uses: ./ + id: setup-java + with: + distribution: ${{ matrix.distribution }} + java-version: | + 11 + 17 + - name: Verify Java env variables + run: | + $versionsArr = "11","17" + foreach ($version in $versionsArr) + { + $envName = "JAVA_HOME_${version}_${env:RUNNER_ARCH}" + $JavaVersionPath = [Environment]::GetEnvironmentVariable($envName) + if (-not (Test-Path "$JavaVersionPath")) { + Write-Host "$envName is not found" + exit 1 + } + } + shell: pwsh + - name: Verify Java + run: bash __tests__/verify-java.sh "17" "${{ steps.setup-java.outputs.path }}" + shell: bash + + setup-java-ea-versions-sapmachine: + name: 5ea sapmachine ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }} + needs: setup-java-major-minor-versions + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + version: ['17-ea', '21-ea'] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: setup-java + uses: ./ + id: setup-java + with: + java-version: ${{ matrix.version }} + distribution: sapmachine + - name: Verify Java + run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" + shell: bash + + setup-java-custom-package-type: + name: 6cpt ${{ matrix.distribution }} ${{ matrix.version }} (${{ matrix.java-package }}-x64) - ${{ matrix.os }} + needs: setup-java-major-minor-versions + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-13, windows-latest, ubuntu-latest] + distribution: ['sapmachine'] + java-package: ['jre'] + version: ['17.0'] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: setup-java + uses: ./ + id: setup-java + with: + java-version: ${{ matrix.version }} + java-package: ${{ matrix.java-package }} + distribution: ${{ matrix.distribution }} + - name: Verify Java + run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}" + shell: bash + + setup-java-version-both-version-inputs-presents: + name: 7vbvip ${{ matrix.distribution }} version (should be from input) - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + distribution: ['sapmachine'] + java-version-file: ['.java-version', '.tool-versions'] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Create .java-version file + shell: bash + run: echo "17" > .java-version + - name: Create .tool-versions file + shell: bash + run: echo "java 17" > .tool-versions + - name: setup-java + uses: ./ + id: setup-java + with: + distribution: ${{ matrix.distribution }} + java-version: 11 + java-version-file: ${{matrix.java-version-file }} + - name: Verify Java + run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}" + shell: bash + + setup-java-version-from-file-major-notation: + name: 8vfgmn ${{ matrix.distribution }} version from file X - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + distribution: ['sapmachine'] + java-version-file: ['.java-version', '.tool-versions'] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Create .java-version file + shell: bash + run: echo "11" > .java-version + - name: Create .tool-versions file + shell: bash + run: echo "java 11" > .tool-versions + - name: setup-java + uses: ./ + id: setup-java + with: + distribution: ${{ matrix.distribution }} + java-version-file: ${{matrix.java-version-file }} + - name: Verify Java + run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}" + shell: bash + + setup-java-version-from-file-major-minor-patch-notation: + name: 9vfgmmpn ${{ matrix.distribution }} version from file X.Y.Z - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + distribution: ['sapmachine'] + java-version-file: ['.java-version', '.tool-versions'] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Create .java-version file + shell: bash + run: echo "17.0.10" > .java-version + - name: Create .tool-versions file + shell: bash + run: echo "java 17.0.10" > .tool-versions + - name: setup-java + uses: ./ + id: setup-java + with: + distribution: ${{ matrix.distribution }} + java-version-file: ${{matrix.java-version-file }} + - name: Verify Java + run: bash __tests__/verify-java.sh "17.0.10" "${{ steps.setup-java.outputs.path }}" + shell: bash + + setup-java-version-from-file-major-minor-patch-with-dist: + name: 10vffmmpwd ${{ matrix.distribution }} version from file 'openjdk64-17.0.10' - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + distribution: ['sapmachine'] + java-version-file: ['.java-version', '.tool-versions'] + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Create .java-version file + shell: bash + run: echo "openjdk64-17.0.10" > .java-version + - name: Create .tool-versions file + shell: bash + run: echo "java openjdk64-17.0.10" > .tool-versions + - name: setup-java + uses: ./ + id: setup-java + with: + distribution: ${{ matrix.distribution }} + java-version-file: ${{matrix.java-version-file }} + - name: Verify Java + run: bash __tests__/verify-java.sh "17.0.10" "${{ steps.setup-java.outputs.path }}" + shell: bash