From ee869eaf9cb07a0c1ddd579a2db3b486beed0f84 Mon Sep 17 00:00:00 2001 From: Malte Poll Date: Fri, 20 Jan 2023 14:32:15 +0100 Subject: [PATCH] ci: prepare upgrade-agent for upload in e2e tests --- .../actions/constellation_create/action.yml | 1 + .github/actions/e2e_test/action.yml | 15 +++++++++++++++ .github/workflows/e2e-test-manual.yml | 18 +++++++++++++----- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/actions/constellation_create/action.yml b/.github/actions/constellation_create/action.yml index 8160352c2..31c1e5899 100644 --- a/.github/actions/constellation_create/action.yml +++ b/.github/actions/constellation_create/action.yml @@ -165,6 +165,7 @@ runs: chmod +x $GITHUB_WORKSPACE/build/cdbg cdbg deploy \ --bootstrapper "${{ github.workspace }}/build/bootstrapper" \ + --upgrade-agent "${{ github.workspace }}/build/upgrade-agent" \ --info logcollect=true \ --info logcollect.github.actor="${{ github.triggering_actor }}" \ --info logcollect.github.workflow="${{ github.workflow }}" \ diff --git a/.github/actions/e2e_test/action.yml b/.github/actions/e2e_test/action.yml index 0e239e7ad..b4cbce80e 100644 --- a/.github/actions/e2e_test/action.yml +++ b/.github/actions/e2e_test/action.yml @@ -117,6 +117,21 @@ runs: if: inputs.isDebugImage == 'true' && runner.os != 'macOS' uses: ./.github/actions/build_bootstrapper + # macOS runners don't have Docker preinstalled, so they cannot build the upgrade-agent. + # But we can use a Linux runner to build it and store/retrieve it from the action cache. + - name: Download the upgrade-agent from cache + id: download-upgrade-agent-cache + if: inputs.isDebugImage == 'true' && runner.os == 'macOS' + uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3 + with: + key: upgrade-agent-${{ github.sha }} + path: "build/upgrade-agent" + + - name: Build the upgrade-agent + id: build-upgrade-agent + if: inputs.isDebugImage == 'true' && runner.os != 'macOS' + uses: ./.github/actions/build_upgrade_agent + - name: Build cdbg id: build-cdbg if: inputs.isDebugImage == 'true' diff --git a/.github/workflows/e2e-test-manual.yml b/.github/workflows/e2e-test-manual.yml index f681e90a3..4caae4a4a 100644 --- a/.github/workflows/e2e-test-manual.yml +++ b/.github/workflows/e2e-test-manual.yml @@ -189,34 +189,42 @@ jobs: needs: [find-latest-image] steps: - name: Setup Go environment - if: github.event.steps.check-bootstrapper-cache.cache-hit != 'true' uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0 with: go-version: "1.19.5" - name: Checkout head - if: github.event.steps.check-bootstrapper-cache.cache-hit != 'true' && inputs.git-ref == 'head' + if: inputs.git-ref == 'head' uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }} - name: Checkout ref - if: github.event.steps.check-bootstrapper-cache.cache-hit != 'true' && inputs.git-ref != 'head' + if: inputs.git-ref != 'head' uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 with: ref: ${{ inputs.git-ref }} - name: Build bootstrapper - if: github.event.steps.check-bootstrapper-cache.cache-hit != 'true' uses: ./.github/actions/build_bootstrapper + - name: Build upgrade-agent + uses: ./.github/actions/build_upgrade_agent + with: + outputPath: ${{ github.workspace }}/build/upgrade-agent + - name: Upload bootstrapper to cache - if: github.event.steps.check-bootstrapper-cache.cache-hit != 'true' uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3 with: key: bootstrapper-${{ github.sha }} path: "build/bootstrapper" + - name: Upload upgrade-agent to cache + uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12 # v3.2.3 + with: + key: upgrade-agent-${{ github.sha }} + path: "build/upgrade-agent" + e2e-test-manual: runs-on: ${{ inputs.runner }} permissions: