From c113eb748fd92585c4edd35383f1444d8d69486c Mon Sep 17 00:00:00 2001 From: Case Wylie Date: Thu, 6 Mar 2025 18:21:28 -0500 Subject: [PATCH] chore: test on fork Signed-off-by: Case Wylie --- .github/actions/ironbank-setup/action.yaml | 16 ++++-- .../pepr-excellent-examples-ironbank-amd.yml | 54 +++++++++++++++++++ .../pepr-excellent-examples-ironbank-arm.yml | 54 +++++++++++++++++++ 3 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/pepr-excellent-examples-ironbank-amd.yml create mode 100644 .github/workflows/pepr-excellent-examples-ironbank-arm.yml diff --git a/.github/actions/ironbank-setup/action.yaml b/.github/actions/ironbank-setup/action.yaml index 4df5d119..100644f1 100644 --- a/.github/actions/ironbank-setup/action.yaml +++ b/.github/actions/ironbank-setup/action.yaml @@ -46,14 +46,24 @@ runs: shell: bash run: echo "PEPR=${GITHUB_WORKSPACE}/pepr" >> "$GITHUB_ENV" + - name: Clone Pepr Excellent Examples + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + repository: defenseunicorns/pepr-excellent-examples + path: pepr-excellent-examples + + - name: "set env: PEPR_EXCELLENT_EXAMPLES_PATH" + shell: bash + run: echo "PEPR_EXCELLENT_EXAMPLES_PATH=${GITHUB_WORKSPACE}/pepr-excellent-examples" >> "$GITHUB_ENV" + - name: Clone Iron Bank Repo & Transfer Dockerfiles shell: bash run: | git clone https://repo1.dso.mil/dsop/opensource/defenseunicorns/pepr/controller.git cd controller - git checkout development mv Dockerfile $PEPR/Dockefile.ironbank.amd mv Dockerfile.arm $PEPR/Dockerfile.ironbank.arm + mv removeScript.js $PEPR/removeScript.js - name: Install Pepr Dependencies shell: bash @@ -65,8 +75,8 @@ runs: shell: bash run: | cd "$PEPR" - docker build -t pepr:amd -f Dockerfile.ironbank.amd . - docker build -t pepr:arm -f Dockerfile.ironbank.arm . + docker build --build-arg PEPR_BUILD_VERSION=dev pepr:amd -f Dockerfile.ironbank.amd . + docker build --build-arg PEPR_BUILD_VERSION=dev -t pepr:arm -f Dockerfile.ironbank.arm . - name: Import Pepr Iron Bank Images into K3d cluster shell: bash diff --git a/.github/workflows/pepr-excellent-examples-ironbank-amd.yml b/.github/workflows/pepr-excellent-examples-ironbank-amd.yml new file mode 100644 index 00000000..81803e35 --- /dev/null +++ b/.github/workflows/pepr-excellent-examples-ironbank-amd.yml @@ -0,0 +1,54 @@ +name: E2E - Pepr Excellent Examples - IronBank AMD Image + +permissions: + contents: read + +on: + workflow_dispatch: + schedule: + - cron: '0 6 * * *' # 2AM EST/11PM PST + +jobs: + setup: + name: controller image + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.create-matrix.outputs.matrix }} + steps: + - name: Environment setup + uses: ./.github/ironbank-actions/setup + with: + registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} + + - name: create matrix + run: | + matrix=$( + node "$PEPR/.github/workflows/pepr-excellent-examples-matrix.js" "$PEPR_EXCELLENT_EXAMPLES_PATH" + ) + echo "matrix=${matrix}" >> "$GITHUB_OUTPUT" + id: create-matrix + + - name: run e2e tests + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 6 + command: | + cd "$PEPR_EXCELLENT_EXAMPLES_PATH" + npm run --workspace=${{ matrix.name }} test:e2e -- \ + --image pepr:amd \ + --custom-package ../pepr-0.0.0-development.tgz + + - name: upload artifacts (troubleshooting) + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 + if: always() + with: + name: "troubleshooting_logs_${{matrix.name}}" + path: | + pepr-excellent-examples/package.json + pepr-excellent-examples/package-lock.json + if-no-files-found: error + retention-days: 1 + diff --git a/.github/workflows/pepr-excellent-examples-ironbank-arm.yml b/.github/workflows/pepr-excellent-examples-ironbank-arm.yml new file mode 100644 index 00000000..4596b801 --- /dev/null +++ b/.github/workflows/pepr-excellent-examples-ironbank-arm.yml @@ -0,0 +1,54 @@ +name: E2E - Pepr Excellent Examples - IronBank ARM Image + +permissions: + contents: read + +on: + workflow_dispatch: + schedule: + - cron: '0 5 * * *' # 1AM EST/10PM PST + +jobs: + setup: + name: controller image + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.create-matrix.outputs.matrix }} + steps: + - name: Environment setup + uses: ./.github/ironbank-actions/setup + with: + registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }} + registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }} + + - name: create matrix + run: | + matrix=$( + node "$PEPR/.github/workflows/pepr-excellent-examples-matrix.js" "$PEPR_EXCELLENT_EXAMPLES_PATH" + ) + echo "matrix=${matrix}" >> "$GITHUB_OUTPUT" + id: create-matrix + + - name: run e2e tests + uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 6 + command: | + cd "$PEPR_EXCELLENT_EXAMPLES_PATH" + npm run --workspace=${{ matrix.name }} test:e2e -- \ + --image pepr:arm \ + --custom-package ../pepr-0.0.0-development.tgz + + - name: upload artifacts (troubleshooting) + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1 + if: always() + with: + name: "troubleshooting_logs_${{matrix.name}}" + path: | + pepr-excellent-examples/package.json + pepr-excellent-examples/package-lock.json + if-no-files-found: error + retention-days: 1 +