From 64da1c873cff82da6a7cc8aa05e7a19c9dc0f5c8 Mon Sep 17 00:00:00 2001 From: Piotr Spieker Date: Tue, 12 Nov 2024 12:56:19 +0100 Subject: [PATCH 1/3] Move release tests into create release workflow --- .../bump-version-and-create-release.yaml | 16 +++++++++++++ .github/workflows/run-release-tests.yaml | 24 ------------------- 2 files changed, 16 insertions(+), 24 deletions(-) delete mode 100644 .github/workflows/run-release-tests.yaml diff --git a/.github/workflows/bump-version-and-create-release.yaml b/.github/workflows/bump-version-and-create-release.yaml index 9790a38..52237e1 100644 --- a/.github/workflows/bump-version-and-create-release.yaml +++ b/.github/workflows/bump-version-and-create-release.yaml @@ -96,3 +96,19 @@ jobs: tag: ${{ needs.compute-version.outputs.new_tag }} body: ${{ github.event.pull_request.body }} + + build-and-run-release-tests: + needs: create-release + runs-on: ubuntu-latest + steps: + - name: Build release test Docker image + uses: docker/build-push-action@v6 + with: + push: false + tags: | + ghcr.io/kit-mrt/util_caching_release_tests + target: release_test + + - name: Run unit tests with/against released version + run: | + docker run --rm ghcr.io/kit-mrt/util_caching_release_tests \ No newline at end of file diff --git a/.github/workflows/run-release-tests.yaml b/.github/workflows/run-release-tests.yaml deleted file mode 100644 index 11fd79c..0000000 --- a/.github/workflows/run-release-tests.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Run release tests - -on: - release: - types: - - released - -jobs: - build-and-run-release-tests: - runs-on: ubuntu-latest - - steps: - - name: Build release test Docker image - uses: docker/build-push-action@v6 - with: - push: false - tags: | - ghcr.io/kit-mrt/util_caching_release_tests - target: release_test - - - name: Run unit tests with/against released version - run: | - docker run --rm ghcr.io/kit-mrt/util_caching_release_tests - From 8bdb541dc1024b1abb48dd631d11852c2b72ff8b Mon Sep 17 00:00:00 2001 From: Piotr Spieker Date: Tue, 12 Nov 2024 13:18:22 +0100 Subject: [PATCH 2/3] Download debian archive for specific release instead of latest --- .github/workflows/bump-version-and-create-release.yaml | 4 +++- Dockerfile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bump-version-and-create-release.yaml b/.github/workflows/bump-version-and-create-release.yaml index 52237e1..6b8743a 100644 --- a/.github/workflows/bump-version-and-create-release.yaml +++ b/.github/workflows/bump-version-and-create-release.yaml @@ -98,12 +98,14 @@ jobs: build-and-run-release-tests: - needs: create-release + needs: [compute-version, create-release] runs-on: ubuntu-latest steps: - name: Build release test Docker image uses: docker/build-push-action@v6 with: + build-args: | + RELEASE_DOWNLOAD_URL=https://github.com/KIT-MRT/util_caching/releases/download/${{ needs.compute-version.outputs.new_tag }} push: false tags: | ghcr.io/kit-mrt/util_caching_release_tests diff --git a/Dockerfile b/Dockerfile index afb8c77..f2c9430 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,10 +48,12 @@ RUN cmake .. && \ FROM base AS release_test +ARG RELEASE_DOWNLOAD_URL=https://github.com/KIT-MRT/util_caching/releases/latest/download/ + # This downloads the latest util_caching debian release and adds it to the docker image # This "bloats" the image. But otherwise, we'd have to installing wget and ca-certificates # temporarily to download and install the package in one docker layer… -ADD https://github.com/KIT-MRT/util_caching/releases/latest/download/libutil-caching-dev.deb /tmp/debfiles/ +ADD ${RELEASE_DOWNLOAD_URL}/libutil-caching-dev.deb /tmp/debfiles/ # Install util_caching from release debian package RUN dpkg -i /tmp/debfiles/*.deb && \ From 417ec2693618e37467ab77c524c65857e5d895f7 Mon Sep 17 00:00:00 2001 From: Piotr Spieker Date: Tue, 12 Nov 2024 13:58:24 +0100 Subject: [PATCH 3/3] Use generic docker tag for release tester image Based on @ll-nick review suggestion --- .github/workflows/bump-version-and-create-release.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bump-version-and-create-release.yaml b/.github/workflows/bump-version-and-create-release.yaml index 6b8743a..8a0ba1c 100644 --- a/.github/workflows/bump-version-and-create-release.yaml +++ b/.github/workflows/bump-version-and-create-release.yaml @@ -107,10 +107,9 @@ jobs: build-args: | RELEASE_DOWNLOAD_URL=https://github.com/KIT-MRT/util_caching/releases/download/${{ needs.compute-version.outputs.new_tag }} push: false - tags: | - ghcr.io/kit-mrt/util_caching_release_tests + tags: release_tester target: release_test - name: Run unit tests with/against released version run: | - docker run --rm ghcr.io/kit-mrt/util_caching_release_tests \ No newline at end of file + docker run --rm release_tester \ No newline at end of file