Skip to content

Commit

Permalink
Merge pull request #90 from aali309/testWithForkedMain5
Browse files Browse the repository at this point in the history
feat(ci): testing5
  • Loading branch information
aali309 authored Oct 24, 2023
2 parents 414ece7 + 317f79f commit ef9d52b
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 51 deletions.
53 changes: 5 additions & 48 deletions .github/workflows/ci-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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


5 changes: 2 additions & 3 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/retest-integrated-test.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ef9d52b

Please sign in to comment.