From dcd3978aac1923335f78ceb9733c73b4e79a529a Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Fri, 2 Feb 2024 11:25:45 -0800 Subject: [PATCH 1/2] ci: ability to run cmx tests against staging --- .github/actions/kots-e2e/action.yml | 5 +++ .github/workflows/build-test.yaml | 53 +++++++++++++++++++++-------- 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/.github/actions/kots-e2e/action.yml b/.github/actions/kots-e2e/action.yml index 3b0927a3c1..a8e202aeb0 100644 --- a/.github/actions/kots-e2e/action.yml +++ b/.github/actions/kots-e2e/action.yml @@ -73,6 +73,9 @@ inputs: replicated-api-token: description: 'Replicated API token for C11y matrix' required: false + replicated-api-endpoint: + description: 'Replicated API endpoint for C11y matrix' + required: false outputs: cluster-id: @@ -93,6 +96,7 @@ runs: uses: replicatedhq/replicated-actions/create-cluster@v1 if: ${{ inputs.k8s-distribution != 'k3s-local' }} with: + replicated-api-endpoint: ${{ inputs.replicated-api-endpoint }} api-token: ${{ inputs.replicated-api-token }} kubernetes-distribution: ${{ inputs.k8s-distribution }} kubernetes-version: ${{ inputs.k8s-version }} @@ -160,5 +164,6 @@ runs: if: ${{ always() && inputs.k8s-cluster-skip-teardown != 'true' && steps.create-cluster.outputs.cluster-id != '' }} continue-on-error: true with: + replicated-api-endpoint: ${{ inputs.replicated-api-endpoint }} api-token: ${{ inputs.replicated-api-token }} cluster-id: ${{ steps.create-cluster.outputs.cluster-id }} diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index a7a21e109e..96b9737060 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -33,10 +33,18 @@ jobs: # Use this to disable tests when iteratig on a specific test to save time enable-tests: runs-on: ubuntu-20.04 + outputs: + cmx_api_token: ${{ steps.vars.outputs.cmx_token }} + cmx_api_endpoint: ${{ steps.vars.outputs.cmx_endpoint }} steps: - name: ok # change 0 to a positive interger to prevent all tests from running run: exit 0 + - name: set outputs + id: vars + run: | + echo "cmx_api_endpoint=" >> "$GITHUB_OUTPUT" + echo "cmx_api_token=${{ secrets.C11Y_MATRIX_TOKEN }}" >> "$GITHUB_OUTPUT" generate-tag: @@ -564,7 +572,8 @@ jobs: id: cmx-versions-to-test uses: ./.github/actions/cmx-versions with: - replicated-api-token: ${{ secrets.C11Y_MATRIX_TOKEN }} + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} outputs: versions-to-test: ${{ steps.cmx-versions-to-test.outputs.versions-to-test }} @@ -599,7 +608,8 @@ jobs: testim-access-token: '${{ secrets.TESTIM_ACCESS_TOKEN }}' aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -639,7 +649,8 @@ jobs: testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -791,7 +802,8 @@ jobs: testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -831,7 +843,8 @@ jobs: testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -980,7 +993,8 @@ jobs: testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -1059,7 +1073,8 @@ jobs: testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -2234,7 +2249,8 @@ jobs: kotsadm-image-registry: ttl.sh aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' k8s-cluster-skip-teardown: true @@ -2301,7 +2317,8 @@ jobs: testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' k8s-cluster-skip-teardown: true @@ -2368,7 +2385,8 @@ jobs: testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' k8s-cluster-skip-teardown: true @@ -2760,7 +2778,8 @@ jobs: testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -2800,7 +2819,8 @@ jobs: testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -2841,7 +2861,8 @@ jobs: kots-airgap: true aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -3860,7 +3881,8 @@ jobs: testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' @@ -3900,7 +3922,8 @@ jobs: testim-branch: ${{ github.head_ref == 'main' && 'master' || github.head_ref }} aws-access-key-id: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_ACCESS_KEY_ID }}' aws-secret-access-key: '${{ secrets.E2E_SUPPORT_BUNDLE_AWS_SECRET_ACCESS_KEY }}' - replicated-api-token: '${{ secrets.C11Y_MATRIX_TOKEN }}' + replicated-api-endpoint: ${{ needs.enable-tests.outputs.cmx_api_endpoint }} + replicated-api-token: ${{ needs.enable-tests.outputs.cmx_api_token }} kots-dockerhub-username: '${{ secrets.E2E_DOCKERHUB_USERNAME }}' kots-dockerhub-password: '${{ secrets.E2E_DOCKERHUB_PASSWORD }}' From a8a56fb4aa4eebf463f1e765a3969b95eeb5fbb9 Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Fri, 2 Feb 2024 11:31:45 -0800 Subject: [PATCH 2/2] f --- .github/workflows/build-test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 96b9737060..6ca4da689a 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -34,8 +34,8 @@ jobs: enable-tests: runs-on: ubuntu-20.04 outputs: - cmx_api_token: ${{ steps.vars.outputs.cmx_token }} - cmx_api_endpoint: ${{ steps.vars.outputs.cmx_endpoint }} + cmx_api_token: ${{ steps.vars.outputs.cmx_api_token }} + cmx_api_endpoint: ${{ steps.vars.outputs.cmx_api_endpoint }} steps: - name: ok # change 0 to a positive interger to prevent all tests from running