From 2340cd59ec489a9c9db6d07bfc497933546422f5 Mon Sep 17 00:00:00 2001 From: Jakub Sliacan Date: Fri, 8 Dec 2023 09:52:27 +0100 Subject: [PATCH] [to-be-removed] print gh context --- .github/workflows/build-tests.yml | 12 + .github/workflows/windows-e2e.yml | 333 ++++++++++++------------ .github/workflows/windows-installer.yml | 6 + 3 files changed, 187 insertions(+), 164 deletions(-) diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml index 45f3b9af69..246e402773 100644 --- a/.github/workflows/build-tests.yml +++ b/.github/workflows/build-tests.yml @@ -16,6 +16,12 @@ jobs: fail-fast: false steps: + + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Check out repository code uses: actions/checkout@v3 @@ -43,6 +49,12 @@ jobs: fail-fast: false steps: + + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Check out repository code uses: actions/checkout@v3 diff --git a/.github/workflows/windows-e2e.yml b/.github/workflows/windows-e2e.yml index f36235c91c..e6afcc0439 100644 --- a/.github/workflows/windows-e2e.yml +++ b/.github/workflows/windows-e2e.yml @@ -17,171 +17,176 @@ jobs: steps: - - name: Create instance - run: | - # Create instance - podman run -d --name windows-create --rm \ - -v ${PWD}:/workspace:z \ - -e ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} \ - -e ARM_SUBSCRIPTION_ID=${{ secrets.ARM_SUBSCRIPTION_ID }} \ - -e ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} \ - -e ARM_CLIENT_SECRET='${{ secrets.ARM_CLIENT_SECRET }}' \ - quay.io/rhqp/qenvs:v0.6.0 azure \ - windows create \ - --project-name 'windows-desktop' \ - --backed-url 'file:///workspace' \ - --conn-details-output '/workspace' \ - --windows-version '${{ matrix.windows-version }}' \ - --windows-featurepack '${{ matrix.windows-featurepack }}' \ - --vmsize 'Standard_D8s_v4' \ - --tags project=openshift-local,source=github,org=${{ github.repository_owner}} \ - --spot - # Check logs - podman logs -f windows-create - - - name: Check instance system info - run: | - ssh -i id_rsa \ - -o StrictHostKeyChecking=no \ - -o UserKnownHostsFile=/dev/null \ - -o ServerAliveInterval=30 \ - -o ServerAliveCountMax=1200 \ - $(cat username)@$(cat host) "systeminfo" - - - name: Download installer - id: download-installer-artifact - uses: dawidd6/action-download-artifact@v2 - with: - workflow: ${{ github.event.workflow_run.workflow_id }} - name: Windows Installer (windows-2022) - - - name: Install CRC on host - run: | - # id_rsa for the host should be in pwd - - HOST=$(cat host) - USER=$(cat username) - TARGET_FOLDER=crc-support - ASSET_FOLDER=/opt/crc-support - podman run --pull=always --rm -d --name crc-win-support \ - -e TARGET_HOST=${HOST} \ - -e TARGET_HOST_USERNAME=${USER} \ - -e TARGET_HOST_KEY_PATH=/data/id_rsa \ - -e TARGET_FOLDER=crc-support \ - -e TARGET_CLEANUP='false' \ - -e OUTPUT_FOLDER=/data \ - -e DEBUG='true' \ - -v ${PWD}:/data:z \ - -v ${PWD}/crc-windows-installer.zip:${ASSET_FOLDER}/crc-windows-installer.zip:z \ - quay.io/rhqp/crc-support:v0.0.4-windows ${TARGET_FOLDER}/run.ps1 \ - -targetPath "/Users/${USER}/${TARGET_FOLDER}" \ - -download 'false' \ - -install 'true' \ - -forceFresh 'false' - - # Check logs - podman logs -f crc-win-support - - - name: Write pull-secret - env: - PULL_SECRET: ${{ secrets.PULL_SECRET }} - run: | - echo $PULL_SECRET > pull-secret - - - name: Download PR number file - id: download-pr-artifact - uses: dawidd6/action-download-artifact@v2 - with: - workflow: ${{ github.event.workflow_run.workflow_id }} - name: pr - - - name: Read PR number - id: pr - uses: juliangruber/read-file-action@v1 - with: - path: ./pr.txt - - - name: Download e2e image - id: download-images-artifact - uses: dawidd6/action-download-artifact@v2 - with: - workflow_conclusion: completed - workflow: build-tests.yml - name: crc-e2e-pr${{ steps.pr.outputs.content }} - - - name: Run CRC e2e + - name: Dump GitHub context env: - PR_NUMBER: ${{ steps.pr.outputs.content }} - run: | - # Get latest built - # curl -OL https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/latest/release-info.json - # VERSION=$(jq -r '.version.crcVersion' release-info.json) - - # load crc-e2e image from tar file - podman load -i crc-e2e.tar - - mkdir output - # id_rsa for the host should be in pwd + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" + + # - name: Create instance + # run: | + # # Create instance + # podman run -d --name windows-create --rm \ + # -v ${PWD}:/workspace:z \ + # -e ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} \ + # -e ARM_SUBSCRIPTION_ID=${{ secrets.ARM_SUBSCRIPTION_ID }} \ + # -e ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} \ + # -e ARM_CLIENT_SECRET='${{ secrets.ARM_CLIENT_SECRET }}' \ + # quay.io/rhqp/qenvs:v0.6.0 azure \ + # windows create \ + # --project-name 'windows-desktop' \ + # --backed-url 'file:///workspace' \ + # --conn-details-output '/workspace' \ + # --windows-version '${{ matrix.windows-version }}' \ + # --windows-featurepack '${{ matrix.windows-featurepack }}' \ + # --vmsize 'Standard_D8s_v4' \ + # --tags project=openshift-local,source=github,org=${{ github.repository_owner}} \ + # --spot + # # Check logs + # podman logs -f windows-create + + # - name: Check instance system info + # run: | + # ssh -i id_rsa \ + # -o StrictHostKeyChecking=no \ + # -o UserKnownHostsFile=/dev/null \ + # -o ServerAliveInterval=30 \ + # -o ServerAliveCountMax=1200 \ + # $(cat username)@$(cat host) "systeminfo" + + # - name: Download installer + # id: download-installer-artifact + # uses: dawidd6/action-download-artifact@v2 + # with: + # workflow: ${{ github.event.workflow_run.workflow_id }} + # name: Windows Installer (windows-2022) + + # - name: Install CRC on host + # run: | + # # id_rsa for the host should be in pwd + + # HOST=$(cat host) + # USER=$(cat username) + # TARGET_FOLDER=crc-support + # ASSET_FOLDER=/opt/crc-support + # podman run --pull=always --rm -d --name crc-win-support \ + # -e TARGET_HOST=${HOST} \ + # -e TARGET_HOST_USERNAME=${USER} \ + # -e TARGET_HOST_KEY_PATH=/data/id_rsa \ + # -e TARGET_FOLDER=crc-support \ + # -e TARGET_CLEANUP='false' \ + # -e OUTPUT_FOLDER=/data \ + # -e DEBUG='true' \ + # -v ${PWD}:/data:z \ + # -v ${PWD}/crc-windows-installer.zip:${ASSET_FOLDER}/crc-windows-installer.zip:z \ + # quay.io/rhqp/crc-support:v0.0.4-windows ${TARGET_FOLDER}/run.ps1 \ + # -targetPath "/Users/${USER}/${TARGET_FOLDER}" \ + # -download 'false' \ + # -install 'true' \ + # -forceFresh 'false' + + # # Check logs + # podman logs -f crc-win-support + + # - name: Write pull-secret + # env: + # PULL_SECRET: ${{ secrets.PULL_SECRET }} + # run: | + # echo $PULL_SECRET > pull-secret + + # - name: Download PR number file + # id: download-pr-artifact + # uses: dawidd6/action-download-artifact@v2 + # with: + # workflow: ${{ github.event.workflow_run.workflow_id }} + # name: pr + + # - name: Read PR number + # id: pr + # uses: juliangruber/read-file-action@v1 + # with: + # path: ./pr.txt + + # - name: Download e2e image + # id: download-images-artifact + # uses: dawidd6/action-download-artifact@v2 + # with: + # workflow_conclusion: completed + # workflow: build-tests.yml + # name: crc-e2e-pr${{ steps.pr.outputs.content }} + + # - name: Run CRC e2e + # env: + # PR_NUMBER: ${{ steps.pr.outputs.content }} + # run: | + # # Get latest built + # # curl -OL https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/latest/release-info.json + # # VERSION=$(jq -r '.version.crcVersion' release-info.json) + + # # load crc-e2e image from tar file + # podman load -i crc-e2e.tar + + # mkdir output + # # id_rsa for the host should be in pwd - HOST=$(cat host) - USER=$(cat username) - # platform tag is inferred from the image - E2E_TAGS="@basic" - TARGET_FOLDER="crc-e2e" - - podman run --rm -d --name crc-e2e \ - -e PLATFORM=windows \ - -e TARGET_HOST=${HOST} \ - -e TARGET_HOST_USERNAME=${USER} \ - -e TARGET_HOST_KEY_PATH=/opt/crc/id_rsa \ - -e PULL_SECRET_FILE_PATH=/opt/crc/pull-secret \ - -e E2E_TAG_EXPRESSION=${E2E_TAGS} \ - -v $PWD/pull-secret:/opt/crc/pull-secret:Z \ - -v $PWD/output:/output:Z \ - -v $PWD/id_rsa:/opt/crc/id_rsa:Z \ - quay.io/crcont/crc-e2e:pr-${PR_NUMBER} \ - -targetFolder ${TARGET_FOLDER} \ - -junitResultsPath ${TARGET_FOLDER}/junit - - # Check logs - podman logs -f crc-e2e - - - name: Test Report - uses: mikepenz/action-junit-report@v4 - if: always() # always run even if the previous step fails - with: - fail_on_failure: true - include_passed: true - detailed_summary: true - require_tests: true - report_paths: '**/*.xml' + # HOST=$(cat host) + # USER=$(cat username) + # # platform tag is inferred from the image + # E2E_TAGS="@basic" + # TARGET_FOLDER="crc-e2e" + + # podman run --rm -d --name crc-e2e \ + # -e PLATFORM=windows \ + # -e TARGET_HOST=${HOST} \ + # -e TARGET_HOST_USERNAME=${USER} \ + # -e TARGET_HOST_KEY_PATH=/opt/crc/id_rsa \ + # -e PULL_SECRET_FILE_PATH=/opt/crc/pull-secret \ + # -e E2E_TAG_EXPRESSION=${E2E_TAGS} \ + # -v $PWD/pull-secret:/opt/crc/pull-secret:Z \ + # -v $PWD/output:/output:Z \ + # -v $PWD/id_rsa:/opt/crc/id_rsa:Z \ + # quay.io/crcont/crc-e2e:pr-${PR_NUMBER} \ + # -targetFolder ${TARGET_FOLDER} \ + # -junitResultsPath ${TARGET_FOLDER}/junit + + # # Check logs + # podman logs -f crc-e2e + + # - name: Test Report + # uses: mikepenz/action-junit-report@v4 + # if: always() # always run even if the previous step fails + # with: + # fail_on_failure: true + # include_passed: true + # detailed_summary: true + # require_tests: true + # report_paths: '**/*.xml' - - name: Upload e2e results - uses: actions/upload-artifact@v3 - if: always() - with: - name: E2E-results-windows-${{ matrix.windows-version }}${{ matrix.windows-featurepack }} - path: | - **/*.xml - **/*.results - **/*.log - - - name: Destroy instance - if: always() - run: | - # Make sure lock is removed - rm -rf .pulumi/locks/* + # - name: Upload e2e results + # uses: actions/upload-artifact@v3 + # if: always() + # with: + # name: E2E-results-windows-${{ matrix.windows-version }}${{ matrix.windows-featurepack }} + # path: | + # **/*.xml + # **/*.results + # **/*.log + + # - name: Destroy instance + # if: always() + # run: | + # # Make sure lock is removed + # rm -rf .pulumi/locks/* - # Destroy instance - podman run -d --name windows-destroy --rm \ - -v ${PWD}:/workspace:z \ - -e ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} \ - -e ARM_SUBSCRIPTION_ID=${{ secrets.ARM_SUBSCRIPTION_ID }} \ - -e ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} \ - -e ARM_CLIENT_SECRET='${{ secrets.ARM_CLIENT_SECRET }}' \ - quay.io/rhqp/qenvs:v0.6.0 azure \ - windows destroy \ - --project-name 'windows-desktop' \ - --backed-url 'file:///workspace' - # Check logs - podman logs -f windows-destroy \ No newline at end of file + # # Destroy instance + # podman run -d --name windows-destroy --rm \ + # -v ${PWD}:/workspace:z \ + # -e ARM_TENANT_ID=${{ secrets.ARM_TENANT_ID }} \ + # -e ARM_SUBSCRIPTION_ID=${{ secrets.ARM_SUBSCRIPTION_ID }} \ + # -e ARM_CLIENT_ID=${{ secrets.ARM_CLIENT_ID }} \ + # -e ARM_CLIENT_SECRET='${{ secrets.ARM_CLIENT_SECRET }}' \ + # quay.io/rhqp/qenvs:v0.6.0 azure \ + # windows destroy \ + # --project-name 'windows-desktop' \ + # --backed-url 'file:///workspace' + # # Check logs + # podman logs -f windows-destroy \ No newline at end of file diff --git a/.github/workflows/windows-installer.yml b/.github/workflows/windows-installer.yml index d6d1c1dbb3..d5b484db33 100644 --- a/.github/workflows/windows-installer.yml +++ b/.github/workflows/windows-installer.yml @@ -11,6 +11,12 @@ jobs: fail-fast: false steps: + + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJSON(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Save the PR number in an artifact shell: bash env: