diff --git a/.github/workflows/ci-build-image.yml b/.github/workflows/ci-build-image.yml index fcefab68c9..0405aed1ae 100644 --- a/.github/workflows/ci-build-image.yml +++ b/.github/workflows/ci-build-image.yml @@ -18,12 +18,6 @@ on: required: false type: boolean default: false - pr-number: - required: false - type: string - sha-value: - required: false - type: string outputs: image-version: description: the Cryostat application version that will be built @@ -52,6 +46,10 @@ jobs: build-image: runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + permissions: + pull-requests: write if: ${{ !inputs.run-tests-only }} needs: [get-pom-properties] steps: @@ -75,7 +73,7 @@ jobs: - name: maven-settings uses: s4u/maven-settings-action@v2 with: - servers: '[{"id": "github", "username": "dummy", "password": "${env.GITHUB_TOKEN_REF}"}]' + servers: '[{"id": "github", "username": "dummy", "password": "${env.GITHUB_TOKEN}"}]' githubServer: true - uses: skjolber/maven-cache-github-action@v1 with: @@ -142,44 +140,3 @@ jobs: with: step: save - retest-integration-tests: #testing - runs-on: ubuntu-latest - if: ${{ !inputs.skip-itests && inputs.run-tests-only && inputs.pr-number != '' && inputs.sha-value != '' }} - steps: - - name: Install xpath - run: | - sudo apt-get update - sudo apt-get install -y libxml-xpath-perl - - name: Install qemu - if: ${{ inputs.build-arch != 'amd64' }} - continue-on-error: true - run: | - sudo apt-get update - sudo apt-get install -y qemu-user-static - - uses: actions/checkout@v4 - with: - repository: ${{ github.repository_owner }}/cryostat - ref: ${{ inputs.checkout-ref }} - submodules: true - fetch-depth: 0 - - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'temurin' - - name: maven-settings - uses: s4u/maven-settings-action@v2 - with: - servers: '[{"id": "github", "username": "dummy", "password": "${env.GITHUB_TOKEN_REF}"}]' - githubServer: true - - name: Pull cryostat image - run: podman pull ghcr.io/${{ github.repository_owner }}/cryostat:pr-${{ inputs.pr-number }}-${{ inputs.sha-value }}-linux-${{ inputs.build-arch }} - - name: Run integration tests - run: POD_NAME=cryostat-itests CONTAINER_NAME=cryostat-itest ITEST_IMG_VERSION=latest bash repeated-integration-tests.bash - - name: Print itest logs - if: failure() - run: ls -1dt target/cryostat-itest-*.log | head -n1 | xargs cat - - name: Print itest container logs - if: failure() - run: ls -1dt target/cryostat-*.server.log | head -n1 | xargs cat - - diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index 28f3275c2a..67bd18bffa 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -89,15 +89,14 @@ jobs: # Add a new step to use /retest retest-integration: - needs: [code-analysis, checkout-branch] + needs: [checkout-branch] if: contains(github.event.comment.body, '/retest') strategy: matrix: arch: [amd64, arm64] - uses: ./.github/workflows/ci-build-image.yml + uses: ./.github/workflows/retest-integrated-test.yml with: build-arch: ${{ matrix.arch }} - run-tests-only: true pr-number: ${{ github.event.issue.number }} sha-value: ${{ needs.checkout-branch.outputs.PR_head_sha }} diff --git a/.github/workflows/retest-integrated-test.yml b/.github/workflows/retest-integrated-test.yml new file mode 100644 index 0000000000..30d70d94a7 --- /dev/null +++ b/.github/workflows/retest-integrated-test.yml @@ -0,0 +1,69 @@ +name: Retest Integrated Tests + +on: + workflow_call: + inputs: + checkout-repo: + required: false + type: string + checkout-ref: + required: false + type: string + build-arch: + required: true + type: string + pr-number: + required: false + type: string + sha-value: + required: false + type: string + +permissions: + contents: read + packages: read + + +jobs: + retest-integration-tests: #test + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + permissions: + pull-requests: write + steps: + - name: Install xpath + run: | + sudo apt-get update + sudo apt-get install -y libxml-xpath-perl + - name: Install qemu + if: ${{ inputs.build-arch != 'amd64' }} + continue-on-error: true + run: | + sudo apt-get update + sudo apt-get install -y qemu-user-static + - uses: actions/checkout@v4 + with: + repository: ${{ github.repository_owner }}/cryostat + ref: ${{ inputs.checkout-ref }} + submodules: true + fetch-depth: 0 + - uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: maven-settings + uses: s4u/maven-settings-action@v2 + with: + servers: '[{"id": "github", "username": "${{ github.event.comment.user.login }}", "password": "${{ env.GITHUB_TOKEN }}"}]' + githubServer: true + - name: Pull cryostat image + run: podman pull ghcr.io/${{ github.repository_owner }}/cryostat:pr-${{ inputs.pr-number }}-${{ inputs.sha-value }}-linux-${{ inputs.build-arch }} + - name: Run integration tests + run: POD_NAME=cryostat-itests CONTAINER_NAME=cryostat-itest ITEST_IMG_VERSION=latest bash repeated-integration-tests.bash + - name: Print itest logs + if: failure() + run: ls -1dt target/cryostat-itest-*.log | head -n1 | xargs cat + - name: Print itest container logs + if: failure() + run: ls -1dt target/cryostat-*.server.log | head -n1 | xargs catyea