From 716962af71b2222ed86a439cbdf35b1767f15be8 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sat, 27 Jan 2024 22:24:38 +0000 Subject: [PATCH 01/19] ops: Add gitea actions CI --- {.github => .gitea}/workflows/ci.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {.github => .gitea}/workflows/ci.yml (100%) diff --git a/.github/workflows/ci.yml b/.gitea/workflows/ci.yml similarity index 100% rename from .github/workflows/ci.yml rename to .gitea/workflows/ci.yml -- 2.49.1 From 105c1be3dfb83b9babc346ec02cc84e5613e6547 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sat, 27 Jan 2024 22:31:04 +0000 Subject: [PATCH 02/19] ops: Add logging to CI --- .gitea/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 5dacc95..280331e 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -14,6 +14,9 @@ jobs: docker-build: runs-on: ubuntu-latest steps: + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 - @@ -40,6 +43,9 @@ jobs: runs-on: ubuntu-latest needs: docker-build steps: + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 - -- 2.49.1 From 2df45c01ff2d1ff983a2a281cffeac21e35370ae Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sat, 27 Jan 2024 22:47:35 +0000 Subject: [PATCH 03/19] ops: Remove amd64 platform limitation --- .devcontainer/devcontainer.json | 3 +-- .gitea/workflows/ci.yml | 8 -------- builder.Dockerfile | 2 +- makefile | 1 - 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5d59fcf..0181f24 100755 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,8 +7,7 @@ }, "workspaceMount": "", "runArgs": [ - "--volume=${localWorkspaceFolder}:/workspaces/${localWorkspaceFolderBasename}:Z", - "--platform=linux/amd64" + "--volume=${localWorkspaceFolder}:/workspaces/${localWorkspaceFolderBasename}:Z" ], "customizations": { "vscode": { diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 280331e..7d52a43 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -14,9 +14,6 @@ jobs: docker-build: runs-on: ubuntu-latest steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 - @@ -43,9 +40,6 @@ jobs: runs-on: ubuntu-latest needs: docker-build steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 - @@ -65,7 +59,6 @@ jobs: run: | docker run \ --rm \ - --platform linux/amd64 \ --workdir /builder/mnt \ -v ${{ github.workspace }}:/builder/mnt \ cproject-builder:latest \ @@ -75,7 +68,6 @@ jobs: run: | docker run \ --rm \ - --platform linux/amd64 \ --workdir /builder/mnt/tests/unittest \ -v ${{ github.workspace }}:/builder/mnt \ cproject-builder:latest \ diff --git a/builder.Dockerfile b/builder.Dockerfile index 0fad747..a6c3395 100644 --- a/builder.Dockerfile +++ b/builder.Dockerfile @@ -2,7 +2,7 @@ ARG base_tag=bullseye ARG base_img=mcr.microsoft.com/vscode/devcontainers/base:dev-${base_tag} # ARG base_img=debian:${base_tag} -FROM --platform=linux/amd64 ${base_img} AS builder-install +FROM ${base_img} AS builder-install # the following shows how to install the latest version of a package. # you can determine the installed version with `apt-cache policy ` and fix diff --git a/makefile b/makefile index 88c2e96..06d561e 100644 --- a/makefile +++ b/makefile @@ -7,7 +7,6 @@ builder-run : docker run \ --rm \ -it \ - --platform linux/amd64 \ --workdir /builder/mnt \ -v .:/builder/mnt \ $(project_name)-builder:latest \ -- 2.49.1 From 8712d22ff5be26c30811f211321695814a446fdb Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sat, 27 Jan 2024 22:57:32 +0000 Subject: [PATCH 04/19] ops(dockerfile): Build rust and clang wrappers from source --- builder.Dockerfile | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/builder.Dockerfile b/builder.Dockerfile index a6c3395..d372742 100644 --- a/builder.Dockerfile +++ b/builder.Dockerfile @@ -57,33 +57,32 @@ RUN ln -s /usr/bin/clang-tidy-${llvm_version} /usr/local/bin/clang-tidy # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # option A: install rust and install clang wrappers via cargo -# this option installs rust and cargo, and then compiles the clang wrappers from scratch. -# this can take a significant amount of time (e.g., several minutes just to compile one tool), -# and also increases the image size significantly. therefore, we go for option B below. +this option installs rust and cargo, and then compiles the clang wrappers from scratch. +this can take a significant amount of time (e.g., several minutes just to compile one tool), +and also increases the image size significantly. therefore, we go for option B below. -# RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y -# ENV PATH=/root/.cargo/bin:$PATH +RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y +ENV PATH=/root/.cargo/bin:$PATH -# Each takes around 280 s to build on an M2 macbook air -# RUN cargo install run-clang-format +Each takes around 280 s to build on an M2 macbook air +RUN cargo install run-clang-format # RUN cargo install run-clang-tidy # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # option B: install pre-built clang wrappers +# RUN mkdir -p /usr/local/run-clang-format +# RUN wget -O clang-utils.tgz "https://github.com/lmapii/run-clang-format/releases/download/v1.4.14/run-clang-format-v1.4.14-i686-unknown-linux-gnu.tar.gz" && \ +# tar -C /usr/local/run-clang-format -xzf clang-utils.tgz --strip-components 1 && \ +# rm clang-utils.tgz +# ENV PATH /usr/local/run-clang-format:$PATH +# RUN run-clang-format --version -RUN mkdir -p /usr/local/run-clang-format -RUN wget -O clang-utils.tgz "https://github.com/lmapii/run-clang-format/releases/download/v1.4.14/run-clang-format-v1.4.14-i686-unknown-linux-gnu.tar.gz" && \ - tar -C /usr/local/run-clang-format -xzf clang-utils.tgz --strip-components 1 && \ - rm clang-utils.tgz -ENV PATH /usr/local/run-clang-format:$PATH -RUN run-clang-format --version - -RUN mkdir -p /usr/local/run-clang-tidy -RUN wget -O clang-utils.tgz "https://github.com/lmapii/run-clang-tidy/releases/download/v0.2.5/run-clang-tidy-v0.2.5-i686-unknown-linux-gnu.tar.gz" && \ - tar -C /usr/local/run-clang-tidy -xzf clang-utils.tgz --strip-components 1 && \ - rm clang-utils.tgz -ENV PATH /usr/local/run-clang-tidy:$PATH -RUN run-clang-tidy --version +# RUN mkdir -p /usr/local/run-clang-tidy +# RUN wget -O clang-utils.tgz "https://github.com/lmapii/run-clang-tidy/releases/download/v0.2.5/run-clang-tidy-v0.2.5-i686-unknown-linux-gnu.tar.gz" && \ +# tar -C /usr/local/run-clang-tidy -xzf clang-utils.tgz --strip-components 1 && \ +# rm clang-utils.tgz +# ENV PATH /usr/local/run-clang-tidy:$PATH +# RUN run-clang-tidy --version # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # install unity and ceedling -- 2.49.1 From 94c1ad26d5509639c6c11f8b972ac882383909fd Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sat, 27 Jan 2024 23:00:25 +0000 Subject: [PATCH 05/19] fix: typos --- builder.Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builder.Dockerfile b/builder.Dockerfile index d372742..0c9600a 100644 --- a/builder.Dockerfile +++ b/builder.Dockerfile @@ -57,16 +57,16 @@ RUN ln -s /usr/bin/clang-tidy-${llvm_version} /usr/local/bin/clang-tidy # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # option A: install rust and install clang wrappers via cargo -this option installs rust and cargo, and then compiles the clang wrappers from scratch. -this can take a significant amount of time (e.g., several minutes just to compile one tool), -and also increases the image size significantly. therefore, we go for option B below. +# this option installs rust and cargo, and then compiles the clang wrappers from scratch. +# this can take a significant amount of time (e.g., several minutes just to compile one tool), +# and also increases the image size significantly. therefore, we go for option B below. RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y ENV PATH=/root/.cargo/bin:$PATH -Each takes around 280 s to build on an M2 macbook air +# Each takes around 280 s to build on an M2 macbook air RUN cargo install run-clang-format -# RUN cargo install run-clang-tidy +RUN cargo install run-clang-tidy # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # option B: install pre-built clang wrappers -- 2.49.1 From bf1882e5287c5f0b9e02ce07ba0a95774e81a823 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sat, 27 Jan 2024 23:02:37 +0000 Subject: [PATCH 06/19] ops: Remove g++-multilib g++-multilib is not availble on arm64 images and causes CI/CD to fail. --- builder.Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/builder.Dockerfile b/builder.Dockerfile index 0c9600a..fb468a7 100644 --- a/builder.Dockerfile +++ b/builder.Dockerfile @@ -15,7 +15,6 @@ RUN apt-get install -y --no-install-recommends \ cmake \ build-essential \ gcc \ - g++-multilib \ locales \ make \ ruby \ -- 2.49.1 From 2fae1da76fe86f8cf3b5cc022033bfb05b1a9da5 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sat, 27 Jan 2024 23:30:44 +0000 Subject: [PATCH 07/19] ops: refactor github -> gitea --- .gitea/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 7d52a43..41f5785 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: docker run \ --rm \ --workdir /builder/mnt \ - -v ${{ github.workspace }}:/builder/mnt \ + -v ${{ gitea.workspace }}:/builder/mnt \ cproject-builder:latest \ /bin/bash -c "rm -rf build; cmake -B build; cmake --build build" - @@ -69,23 +69,23 @@ jobs: docker run \ --rm \ --workdir /builder/mnt/tests/unittest \ - -v ${{ github.workspace }}:/builder/mnt \ + -v ${{ gitea.workspace }}:/builder/mnt \ cproject-builder:latest \ /bin/bash -c "ceedling clobber; ceedling gcov:all; ceedling utils:gcov" - name: Archive coverage results shell: bash run: | - staging="reports-${{github.run_number}}" + staging="reports-${{gitea.run_number}}" mkdir -p "$staging" cp -r tests/unittest/build/artifacts/gcov "$staging" tar czf "$staging.tar.gz" "$staging" - echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV + echo "ASSET=$staging.tar.gz" >> $GITEA_ENV - name: Archive artifacts uses: actions/upload-artifact@v3 with: - name: reports-${{github.run_number}} + name: reports-${{gitea.run_number}} path: ${{ env.ASSET }} retention-days: 3 -- 2.49.1 From 13bcb67fa5997062ea61cb0f49dd9b28d6062ae4 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 00:35:27 +0000 Subject: [PATCH 08/19] test: Remove -m32 flag --- tests/unittest/project.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/unittest/project.yml b/tests/unittest/project.yml index 72c976c..58d94e4 100644 --- a/tests/unittest/project.yml +++ b/tests/unittest/project.yml @@ -102,24 +102,20 @@ - -Wall - -g0 - -O3 - - -m32 :link: :*: - -g0 - -O3 - - -m32 :gcov: :compile: :*: - -g0 - -O3 - -Wall - - -m32 :link: :*: - -g0 - -O3 - - -m32 # LIBRARIES -- 2.49.1 From 57cccd1cf2d826fa83889cc86b176198cb68bce8 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 01:01:40 +0000 Subject: [PATCH 09/19] ops: Fix caching --- .gitea/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 41f5785..bf210bc 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Restore docker image id: cache-docker - uses: actions/cache@v3 + uses: https://github.com/actions/cache@v3 with: path: /tmp/docker key: ${{ runner.os }}-docker-${{ hashFiles('builder.Dockerfile') }} @@ -45,7 +45,7 @@ jobs: - name: Restore docker image id: cache-docker - uses: actions/cache@v3 + uses: https://github.com/actions/cache@v3 with: path: /tmp/docker key: ${{ runner.os }}-docker-${{ hashFiles('builder.Dockerfile') }} -- 2.49.1 From 63a82cff819374eb28066da629c3efd4500290f5 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 01:21:17 +0000 Subject: [PATCH 10/19] ops: Fix staging --- .gitea/workflows/ci.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index bf210bc..d523152 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Restore docker image id: cache-docker - uses: https://github.com/actions/cache@v3 + uses: actions/cache@v3 with: path: /tmp/docker key: ${{ runner.os }}-docker-${{ hashFiles('builder.Dockerfile') }} @@ -45,7 +45,7 @@ jobs: - name: Restore docker image id: cache-docker - uses: https://github.com/actions/cache@v3 + uses: actions/cache@v3 with: path: /tmp/docker key: ${{ runner.os }}-docker-${{ hashFiles('builder.Dockerfile') }} @@ -80,13 +80,12 @@ jobs: mkdir -p "$staging" cp -r tests/unittest/build/artifacts/gcov "$staging" tar czf "$staging.tar.gz" "$staging" - echo "ASSET=$staging.tar.gz" >> $GITEA_ENV - name: Archive artifacts uses: actions/upload-artifact@v3 with: name: reports-${{gitea.run_number}} - path: ${{ env.ASSET }} + path: reports-${{gitea.run_number}}.tar.gz retention-days: 3 # TODO: delete cache on merge. -- 2.49.1 From a62f2be129e7511f903904533943e2c4afc82370 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 01:29:16 +0000 Subject: [PATCH 11/19] ops: hashFiles workaround https://docs.gitea.com/next/usage/actions/comparison#hashfiles-expression --- .gitea/workflows/ci.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d523152..f0c168b 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -19,13 +19,19 @@ jobs: - name: Create docker cache folder run: mkdir -p /tmp/docker + - + name: Hash dockerfile + id: dockerfile-hash + uses: actions/go-hashfiles@v0.0.1 + with: + patterns: builder.Dockerfile - name: Restore docker image id: cache-docker uses: actions/cache@v3 with: path: /tmp/docker - key: ${{ runner.os }}-docker-${{ hashFiles('builder.Dockerfile') }} + key: ${{ runner.os }}-docker-${{ steps.dockerfile-hash.outputs.hash }} - name: Build docker builder-image if: steps.cache-docker.outputs.cache-hit != 'true' @@ -42,13 +48,19 @@ jobs: steps: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 + - + name: Hash dockerfile + id: dockerfile-hash + uses: actions/go-hashfiles@v0.0.1 + with: + patterns: builder.Dockerfile - name: Restore docker image id: cache-docker uses: actions/cache@v3 with: path: /tmp/docker - key: ${{ runner.os }}-docker-${{ hashFiles('builder.Dockerfile') }} + key: ${{ runner.os }}-docker-${{ steps.dockerfile-hash.outputs.hash }} - name: Load image run: | -- 2.49.1 From 49e785f6e59d51c30a2d8ddef27f4847f4843b6c Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 01:34:51 +0000 Subject: [PATCH 12/19] ops: fix go-hashfiles url --- .gitea/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index f0c168b..f30b760 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Hash dockerfile id: dockerfile-hash - uses: actions/go-hashfiles@v0.0.1 + uses: https://gitea.com/actions/go-hashfiles@v0.0.1 with: patterns: builder.Dockerfile - @@ -51,7 +51,7 @@ jobs: - name: Hash dockerfile id: dockerfile-hash - uses: actions/go-hashfiles@v0.0.1 + uses: https://gitea.com/actions/go-hashfiles@v0.0.1 with: patterns: builder.Dockerfile - -- 2.49.1 From 934dacefa841a83fc78155b4c7d91395415302b8 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 01:36:49 +0000 Subject: [PATCH 13/19] ops: setup go --- .gitea/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index f30b760..2f52bc5 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -16,6 +16,9 @@ jobs: steps: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 + - uses: actions/setup-go@v3 + with: + go-version: '1.20' - name: Create docker cache folder run: mkdir -p /tmp/docker @@ -48,6 +51,9 @@ jobs: steps: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 + - uses: actions/setup-go@v3 + with: + go-version: '1.20' - name: Hash dockerfile id: dockerfile-hash -- 2.49.1 From 0baa6ea92fbe092bfdc20f61d4596c404104ecfa Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 02:20:39 +0000 Subject: [PATCH 14/19] ops: Add back GITHUB_ENV usage --- .gitea/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 2f52bc5..2d5f879 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -98,12 +98,13 @@ jobs: mkdir -p "$staging" cp -r tests/unittest/build/artifacts/gcov "$staging" tar czf "$staging.tar.gz" "$staging" + echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV - name: Archive artifacts uses: actions/upload-artifact@v3 with: name: reports-${{gitea.run_number}} - path: reports-${{gitea.run_number}}.tar.gz + path: ${{ env.ASSET }} retention-days: 3 # TODO: delete cache on merge. -- 2.49.1 From eac66ef4ed34b6d249a6039650a55d0bb4398d6f Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 02:35:04 +0000 Subject: [PATCH 15/19] Install docker for use in container --- .gitea/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 2d5f879..8be7e62 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -51,6 +51,8 @@ jobs: steps: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 + - name: Install Docker + run: curl -fsSL https://get.docker.com | sh - uses: actions/setup-go@v3 with: go-version: '1.20' @@ -78,7 +80,7 @@ jobs: docker run \ --rm \ --workdir /builder/mnt \ - -v ${{ gitea.workspace }}:/builder/mnt \ + -v ${{ github.workspace }}:/builder/mnt \ cproject-builder:latest \ /bin/bash -c "rm -rf build; cmake -B build; cmake --build build" - @@ -87,14 +89,14 @@ jobs: docker run \ --rm \ --workdir /builder/mnt/tests/unittest \ - -v ${{ gitea.workspace }}:/builder/mnt \ + -v ${{ github.workspace }}:/builder/mnt \ cproject-builder:latest \ /bin/bash -c "ceedling clobber; ceedling gcov:all; ceedling utils:gcov" - name: Archive coverage results shell: bash run: | - staging="reports-${{gitea.run_number}}" + staging="reports-${{github.run_number}}" mkdir -p "$staging" cp -r tests/unittest/build/artifacts/gcov "$staging" tar czf "$staging.tar.gz" "$staging" @@ -103,7 +105,7 @@ jobs: name: Archive artifacts uses: actions/upload-artifact@v3 with: - name: reports-${{gitea.run_number}} + name: reports-${{github.run_number}} path: ${{ env.ASSET }} retention-days: 3 -- 2.49.1 From 9fb0ab842d5a7fe52d8e936c02c980779a0abe9c Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 02:50:43 +0000 Subject: [PATCH 16/19] Use apt's docker --- .gitea/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 8be7e62..b61dc1c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -52,7 +52,9 @@ jobs: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 - name: Install Docker - run: curl -fsSL https://get.docker.com | sh + run: | + apt update + apt install -y docker - uses: actions/setup-go@v3 with: go-version: '1.20' -- 2.49.1 From 401f508d39ce455000045e55b4cfa79bd0407637 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 03:59:40 +0000 Subject: [PATCH 17/19] ops: use docker-run-action --- .gitea/workflows/ci.yml | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index b61dc1c..73a8287 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -51,10 +51,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v2 - - name: Install Docker - run: | - apt update - apt install -y docker - uses: actions/setup-go@v3 with: go-version: '1.20' @@ -71,28 +67,21 @@ jobs: with: path: /tmp/docker key: ${{ runner.os }}-docker-${{ steps.dockerfile-hash.outputs.hash }} - - - name: Load image - run: | - docker load --input /tmp/docker/${{ runner.os }}-builder-image.tar - docker image ls -a - name: Build library - run: | - docker run \ - --rm \ - --workdir /builder/mnt \ - -v ${{ github.workspace }}:/builder/mnt \ - cproject-builder:latest \ + uses: https://github.com/addnab/docker-run-action@v3 + with: + image: cproject-builder:latest + options: -v ${{ github.workspace }}:/builder/mnt --workdir /builder/mnt + run: | /bin/bash -c "rm -rf build; cmake -B build; cmake --build build" - name: Test library - run: | - docker run \ - --rm \ - --workdir /builder/mnt/tests/unittest \ - -v ${{ github.workspace }}:/builder/mnt \ - cproject-builder:latest \ + uses: https://github.com/addnab/docker-run-action@v3 + with: + image: cproject-builder:latest + options: -v ${{ github.workspace }}:/builder/mnt --workdir /builder/mnt + run: | /bin/bash -c "ceedling clobber; ceedling gcov:all; ceedling utils:gcov" - name: Archive coverage results -- 2.49.1 From 39510cca05daa8da4fe3c1c6f54052d40ffdd1df Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 04:17:31 +0000 Subject: [PATCH 18/19] ops: Add --volumes-from option --- .gitea/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 73a8287..cb8f196 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: uses: https://github.com/addnab/docker-run-action@v3 with: image: cproject-builder:latest - options: -v ${{ github.workspace }}:/builder/mnt --workdir /builder/mnt + options: -v ${{ github.workspace }}:/builder/mnt --workdir /builder/mnt --volumes-from ${{ env.JOB_CONTAINER_NAME }} run: | /bin/bash -c "rm -rf build; cmake -B build; cmake --build build" - @@ -80,7 +80,7 @@ jobs: uses: https://github.com/addnab/docker-run-action@v3 with: image: cproject-builder:latest - options: -v ${{ github.workspace }}:/builder/mnt --workdir /builder/mnt + options: -v ${{ github.workspace }}:/builder/mnt --workdir /builder/mnt --volumes-from ${{ env.JOB_CONTAINER_NAME }} run: | /bin/bash -c "ceedling clobber; ceedling gcov:all; ceedling utils:gcov" - -- 2.49.1 From 6c0b9c6b5cc362aa7cec14f3954b51af6b4f4306 Mon Sep 17 00:00:00 2001 From: Brock Allen Date: Sun, 28 Jan 2024 06:59:08 +0000 Subject: [PATCH 19/19] ops: try to get volumes mounted --- .gitea/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index cb8f196..47a5ef8 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -72,17 +72,17 @@ jobs: uses: https://github.com/addnab/docker-run-action@v3 with: image: cproject-builder:latest - options: -v ${{ github.workspace }}:/builder/mnt --workdir /builder/mnt --volumes-from ${{ env.JOB_CONTAINER_NAME }} + options: --volumes-from ${{ env.JOB_CONTAINER_NAME }} run: | - /bin/bash -c "rm -rf build; cmake -B build; cmake --build build" + /bin/bash -c "cd ${{ github.workspace }}; rm -rf build; cmake -B build; cmake --build build" - name: Test library uses: https://github.com/addnab/docker-run-action@v3 with: image: cproject-builder:latest - options: -v ${{ github.workspace }}:/builder/mnt --workdir /builder/mnt --volumes-from ${{ env.JOB_CONTAINER_NAME }} + options: --volumes-from ${{ env.JOB_CONTAINER_NAME }} run: | - /bin/bash -c "ceedling clobber; ceedling gcov:all; ceedling utils:gcov" + /bin/bash -c "cd ${{ github.workspace }}/tests/unittest; ceedling clobber; ceedling gcov:all; ceedling utils:gcov" - name: Archive coverage results shell: bash -- 2.49.1