|
| 1 | +name: Manual GM candidate container test - Java 21 |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + build: |
| 7 | + description: Build level as cl241020240923-1638 |
| 8 | + required: true |
| 9 | + date: |
| 10 | + description: Dev date as 2024-09-23_1638 |
| 11 | + required: true |
| 12 | + ol_version: |
| 13 | + description: OL version as 24.0.0.10 |
| 14 | + required: true |
| 15 | + guide: |
| 16 | + description: Guide to build |
| 17 | + default: "all" |
| 18 | + required: true |
| 19 | + branch: |
| 20 | + description: Branch to test |
| 21 | + required: false |
| 22 | + |
| 23 | +env: |
| 24 | + DOCKER_USERNAME: ${{ secrets.CP_STG_USERNAME }} |
| 25 | + DOCKER_PASSWORD: ${{ secrets.CP_STG_PASSWORD }} |
| 26 | + CHANGE_MINIKUBE_NONE_USER: true |
| 27 | + |
| 28 | +jobs: |
| 29 | + get-guide-repos: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + outputs: |
| 32 | + repos: ${{ steps.create-list.outputs.repos }}${{ steps.input-guide.outputs.repo }} |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v2 |
| 35 | + - name: Get repos |
| 36 | + if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' && github.event.inputs.guide == 'all' }} |
| 37 | + id: create-list |
| 38 | + run: echo "repos=[ 'guide-spring-boot' ]" >> $GITHUB_OUTPUT |
| 39 | + - name: Set repo |
| 40 | + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.guide != 'all' }} |
| 41 | + id: input-guide |
| 42 | + run: echo "::set-output name=repo::[ '${{ github.event.inputs.guide }}' ]" |
| 43 | + build-level: |
| 44 | + runs-on: ubuntu-latest |
| 45 | + steps: |
| 46 | + - name: Starting GM candidate container tests for ${{ github.event.inputs.build }} |
| 47 | + run: | |
| 48 | + echo "Inputs: " |
| 49 | + echo build: ${{ github.event.inputs.build }} |
| 50 | + echo date: ${{ github.event.inputs.date }} |
| 51 | + echo ol_version: ${{ github.event.inputs.ol_version }} |
| 52 | + echo driver: openliberty-all-${{ github.event.inputs.ol_version }}-${{ github.event.inputs.build }}.zip |
| 53 | + echo guide: ${{ github.event.inputs.guide }} |
| 54 | + echo branch: ${{ github.event.inputs.branch }} |
| 55 | + test-guide: |
| 56 | + needs: [ get-guide-repos ] |
| 57 | + runs-on: ubuntu-latest |
| 58 | + strategy: |
| 59 | + fail-fast: false |
| 60 | + max-parallel: 5 |
| 61 | + matrix: |
| 62 | + repos: ${{ fromJson(needs.get-guide-repos.outputs.repos) }} |
| 63 | + jdk: [ "21" ] |
| 64 | + steps: |
| 65 | + - name: Setup JDK ${{ matrix.jdk }} |
| 66 | + uses: actions/setup-java@v1 |
| 67 | + with: |
| 68 | + java-version: ${{ matrix.jdk }} |
| 69 | + - name: Clone ${{ matrix.repos }} |
| 70 | + uses: actions/checkout@v2 |
| 71 | + with: |
| 72 | + repository: OpenLiberty/${{ matrix.repos }} |
| 73 | + ref: ${{ github.event.inputs.branch }} |
| 74 | + path: ${{ matrix.repos }} |
| 75 | + - name: Set permissions |
| 76 | + run: chmod +x ${{ matrix.repos }}/scripts/*.sh |
| 77 | + - name: Docker login |
| 78 | + run: echo $DOCKER_PASSWORD | sudo docker login -u $DOCKER_USERNAME --password-stdin cp.stg.icr.io |
| 79 | + - name: Run tests for ${{ matrix.repos }} |
| 80 | + working-directory: ${{ matrix.repos }}/finish |
| 81 | + env: |
| 82 | + DEVDATE: ${{ github.event.inputs.date }} |
| 83 | + DRIVER: openliberty-all-${{ github.event.inputs.ol_version }}-${{ github.event.inputs.build }}.zip |
| 84 | + OL_VERSION: ${{ github.event.inputs.ol_version }} |
| 85 | + run: sudo -E ../scripts/dockerImageTest.sh -t $DEVDATE -d $DRIVER -v $OL_VERSION |
| 86 | + - name: Post tests |
| 87 | + working-directory: ${{ matrix.repos }} |
| 88 | + if: always() |
| 89 | + run: | |
| 90 | + mvn -version |
| 91 | + sudo chmod -R 777 . |
| 92 | + logsPath=$(sudo find . -name "console.log"); |
| 93 | + if [ -z "$logsPath" ] |
| 94 | + then |
| 95 | + logsPath=$(sudo find . -name "messages.log"); |
| 96 | + if [ -z "$logsPath" ] |
| 97 | + then sudo docker images |
| 98 | + else |
| 99 | + sudo cat $logsPath | grep product |
| 100 | + sudo cat $logsPath | grep java.runtime |
| 101 | + fi |
| 102 | + else sudo cat $logsPath | grep Launching |
| 103 | + fi |
| 104 | + - name: Archive server logs if failed |
| 105 | + if: failure() |
| 106 | + uses: actions/upload-artifact@v4 |
| 107 | + with: |
| 108 | + name: ${{ matrix.repos }}-logs |
| 109 | + path: | |
| 110 | + ${{ matrix.repos }}/finish/target/liberty/wlp/usr/servers/defaultServer/logs/ |
| 111 | + ${{ matrix.repos }}/finish/**/target/liberty/wlp/usr/servers/defaultServer/logs/ |
| 112 | + if-no-files-found: ignore |
| 113 | + slack-alert: |
| 114 | + needs: [test-guide] |
| 115 | + if: failure() |
| 116 | + runs-on: ubuntu-latest |
| 117 | + env: |
| 118 | + BUILDLEVEL: ${{ github.event.inputs.build }} |
| 119 | + DEVDATE: ${{ github.event.inputs.date }} |
| 120 | + DRIVER: openliberty-all-${{ github.event.inputs.ol_version }}-${{ github.event.inputs.build }}.zip |
| 121 | + steps: |
| 122 | + - uses: actions/checkout@v2 |
| 123 | + - name: send-status |
| 124 | + run: | |
| 125 | + python3 .github/workflows/slack-alert.py ${{ env.BUILDLEVEL }} ${{ env.DRIVER }} ${{ env.DEVDATE }} ${{ needs.test-guide.result }} \ |
| 126 | + ${{ github.repository }} ${{ github.run_id }} ${{ secrets.SLACK_HOOK }} |
| 127 | + echo ${{ needs.test-guide.result }} |
0 commit comments