From d51a6af525b744eb8ca7bea4ba7330b216dab4cd Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Wed, 1 Jul 2026 13:44:58 +0200 Subject: [PATCH 01/50] Include Github Action scripts Signed-off-by: Ritesh.K --- .github/workflows/build.yml | 120 ++++++++++++++++++++++ .github/workflows/ci.yml | 50 +++++++++ .github/workflows/deploy.yml | 117 +++++++++++++++++++++ .github/workflows/mirror.yaml | 27 ----- .github/workflows/packaging.yml | 174 ++++++++++++++++++++++++++++++++ .github/workflows/prepare.yml | 79 +++++++++++++++ .github/workflows/test.yml | 172 +++++++++++++++++++++++++++++++ 7 files changed, 712 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/deploy.yml delete mode 100644 .github/workflows/mirror.yaml create mode 100644 .github/workflows/packaging.yml create mode 100644 .github/workflows/prepare.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..379852306 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,120 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: Build + +on: + workflow_call: + +env: + CMAKE_BUILD_OPTS: --parallel 16 + CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release + CACHIX_CACHE_NAME: villas + +permissions: + contents: read + packages: write + +jobs: + build-source: + name: "build:source [${{ matrix.distro }}]" + runs-on: ubuntu-latest + container: + image: ghcr.io/${{ github.repository_owner }}/villas/node/dev-${{ matrix.image_name }}:${{ github.sha }} + options: --user root + strategy: + fail-fast: false + matrix: + include: + - distro: fedora + image_name: fedora + cmake_extra_opts: -DVILLAS_COMPILE_WARNING_AS_ERROR=ON + - distro: fedora-minimal + image_name: fedora-minimal + cmake_extra_opts: >- + -DVILLAS_COMPILE_WARNING_AS_ERROR=ON + -DWITH_API=OFF + -DWITH_CLIENTS=OFF + -DWITH_CONFIG=OFF + -DWITH_DOC=OFF + -DWITH_FPGA=OFF + -DWITH_GRAPHVIZ=OFF + -DWITH_HOOKS=OFF + -DWITH_LUA=OFF + -DWITH_OPENMP=OFF + -DWITH_PLUGINS=OFF + -DWITH_SRC=OFF + -DWITH_TESTS=OFF + -DWITH_TOOLS=OFF + -DWITH_WEB=OFF + -DCMAKE_MODULE_PATH=/usr/local/lib64/cmake + -DCMAKE_PREFIX_PATH=/usr/local + - distro: debian + image_name: debian + - distro: rocky + image_name: rocky + - distro: rocky9 + image_name: rocky9 + - distro: ubuntu + image_name: ubuntu + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Configure + run: cmake -S . -B build ${{ matrix.cmake_extra_opts || env.CMAKE_EXTRA_OPTS }} + + - name: Build + run: cmake --build build ${{ env.CMAKE_BUILD_OPTS }} + + - uses: actions/upload-artifact@v4 + with: + name: build-${{ matrix.distro }} + path: build/ + retention-days: 7 + + # build-nix: + # name: "build:nix [${{ matrix.system }}]" + # runs-on: ubuntu-latest + # container: + # image: docker.nix-community.org/nixpkgs/cachix-flakes + # strategy: + # fail-fast: false + # matrix: + # system: [x86_64-linux, aarch64-linux] + # steps: + # - uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # submodules: recursive + # + # - name: Configure Cachix + # run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + # env: + # CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + # + # - name: Build + # run: | + # cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + # nix build --print-build-logs ".#villas-node-${{ matrix.system }}" + + build-openapi: + name: build:openapi + runs-on: ubuntu-latest + container: + image: node:24-alpine + steps: + - uses: actions/checkout@v4 + + - name: Lint OpenAPI spec + run: npx -y @redocly/cli lint --config doc/redocly.yaml doc/openapi/openapi.yaml + + - name: Build OpenAPI docs + run: npx -y @redocly/cli build-docs --config doc/redocly.yaml doc/openapi/openapi.yaml --output openapi.html + + - uses: actions/upload-artifact@v4 + with: + name: openapi + path: openapi.html diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..3f0adc93f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: CI + +on: + push: + branches: + tags: + pull_request: + branches: + workflow_dispatch: + inputs: + publish_latest: + description: Publish dev and app images as latest + type: boolean + default: false + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + prepare: + uses: ./.github/workflows/prepare.yml + secrets: inherit + + build: + needs: [prepare] + uses: ./.github/workflows/build.yml + secrets: inherit + + test: + needs: [build] + uses: ./.github/workflows/test.yml + secrets: inherit + + packaging: + if: github.event_name != 'pull_request' + needs: [test] + uses: ./.github/workflows/packaging.yml + secrets: inherit + + deploy: + if: github.event_name != 'pull_request' + needs: [packaging] + uses: ./.github/workflows/deploy.yml + with: + publish_latest: ${{ github.event_name == 'workflow_dispatch' && inputs.publish_latest || false }} + secrets: inherit diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..85583cff7 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,117 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: Deploy + +on: + workflow_call: + inputs: + publish_latest: + required: false + type: boolean + default: false + +env: + REGISTRY: ghcr.io + DOCKER_IMAGE: ghcr.io/${{ github.repository_owner }}/villas/node + +permissions: + contents: read + packages: write + +jobs: + deploy-docker: + name: deploy:docker + runs-on: ubuntu-latest + steps: + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create and push multi-arch manifest + run: | + docker manifest rm "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" || true + docker manifest create "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" \ + "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ + "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" + docker manifest push "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" + + latest-docker: + name: latest:docker + if: startsWith(github.ref, 'refs/tags/v') + needs: [deploy-docker] + runs-on: ubuntu-latest + steps: + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Tag and push app image as latest + run: | + docker manifest rm "${{ env.DOCKER_IMAGE }}:latest" || true + docker manifest create "${{ env.DOCKER_IMAGE }}:latest" \ + "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ + "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" + docker manifest push "${{ env.DOCKER_IMAGE }}:latest" + + latest-docker-dev: + name: latest:docker-dev + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Tag and push dev image as latest + run: | + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}/dev:latest" \ + "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" + + latest-docker-manual: + name: latest:docker (manual) + if: inputs.publish_latest + needs: [deploy-docker] + runs-on: ubuntu-latest + steps: + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Tag and push app image as latest (manual) + run: | + docker manifest rm "${{ env.DOCKER_IMAGE }}:latest" || true + docker manifest create "${{ env.DOCKER_IMAGE }}:latest" \ + "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ + "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" + docker manifest push "${{ env.DOCKER_IMAGE }}:latest" + + latest-docker-dev-manual: + name: latest:docker-dev (manual) + if: inputs.publish_latest + runs-on: ubuntu-latest + steps: + - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Tag and push dev image as latest (manual) + run: | + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}/dev:latest" \ + "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" diff --git a/.github/workflows/mirror.yaml b/.github/workflows/mirror.yaml deleted file mode 100644 index 7762b1a80..000000000 --- a/.github/workflows/mirror.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# SPDX-FileCopyrightText: 2025 OPAL-RT Germany GmbH -# SPDX-License-Identifier: Apache-2.0 - ---- -name: Mirror to RWTH GitLab - -on: - push: - delete: - -jobs: - mirror: - name: Mirror - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: yesolutions/mirror-action@master - with: - REMOTE: https://git.rwth-aachen.de/acs/public/villas/node.git - GIT_USERNAME: github - GIT_PASSWORD: ${{ secrets.RWTH_GITLAB_TOKEN }} - PUSH_ALL_REFS: "false" diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml new file mode 100644 index 000000000..2095c2a33 --- /dev/null +++ b/.github/workflows/packaging.yml @@ -0,0 +1,174 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: Packaging + +on: + workflow_call: + +env: + REGISTRY: ghcr.io + DOCKER_IMAGE: ghcr.io/${{ github.repository_owner }}/villas/node + CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release + CACHIX_CACHE_NAME: villas + +permissions: + contents: read + packages: write + +jobs: + pkg-docker: + name: "pkg:docker [${{ matrix.arch }}]" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - distro: debian + platform: linux/amd64 + arch: x86_64 + triplet: x86_64-linux-gnu + - distro: debian + platform: linux/arm64 + arch: arm64 + triplet: aarch64-linux-gnu + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - uses: docker/setup-qemu-action@v3 + if: matrix.arch != 'x86_64' + + - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/build-push-action@v6 + with: + context: . + file: packaging/docker/Dockerfile.${{ matrix.distro }} + target: app + push: true + pull: true + platforms: ${{ matrix.platform }} + build-args: | + ARCH=${{ matrix.arch }} + TRIPLET=${{ matrix.triplet }} + CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} + tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-${{ matrix.arch }} + + pkg-nix-arx: + name: "pkg:nix:arx [${{ matrix.system }}]" + runs-on: ubuntu-latest + container: + image: docker.nix-community.org/nixpkgs/cachix-flakes + strategy: + fail-fast: false + matrix: + system: [x86_64-linux, aarch64-linux] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Configure Cachix + run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + env: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - name: Bundle as arx + run: | + cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + nix bundle --print-build-logs --out-link bundle-arx \ + --bundler github:nix-community/nix-bundle \ + ".#villas-node-${{ matrix.system }}" + mkdir -p artifacts + cp -L bundle-arx artifacts/villas-${{ matrix.system }} + + - uses: actions/upload-artifact@v4 + with: + name: villas-arx-${{ matrix.system }} + path: artifacts/ + retention-days: 365 + + pkg-nix-rpm: + name: "pkg:nix:rpm [${{ matrix.system }}]" + runs-on: ubuntu-latest + container: + image: docker.nix-community.org/nixpkgs/cachix-flakes + strategy: + fail-fast: false + matrix: + system: [x86_64-linux, aarch64-linux] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Configure Cachix + run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + env: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - name: Bundle as RPM + run: | + cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + nix bundle --print-build-logs --out-link bundle-rpm \ + --bundler github:NixOS/bundlers#toRPM \ + ".#villas-node-${{ matrix.system }}" + mkdir -p artifacts + cp -L bundle-rpm/*.rpm artifacts/villas-${{ matrix.system }}.rpm + + - uses: actions/upload-artifact@v4 + with: + name: villas-rpm-${{ matrix.system }} + path: artifacts/ + retention-days: 365 + + pkg-nix-docker: + name: "pkg:nix:docker [${{ matrix.system }}]" + runs-on: ubuntu-latest + container: + image: docker.nix-community.org/nixpkgs/cachix-flakes + strategy: + fail-fast: false + matrix: + system: [x86_64-linux, aarch64-linux] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Configure Cachix + run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + env: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - name: Bundle as Docker image + run: | + mkdir -p /var/tmp/ + cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + nix bundle --print-build-logs --out-link bundle-docker \ + --bundler github:NixOS/bundlers#toDockerImage \ + ".#villas-node-${{ matrix.system }}" + + - name: Push to registry + run: | + nix run nixpkgs#skopeo -- login \ + --username "${{ github.actor }}" \ + --password "${{ secrets.GITHUB_TOKEN }}" \ + "${{ env.REGISTRY }}" + nix run nixpkgs#skopeo -- \ + --tmpdir="${{ runner.temp }}" \ + --insecure-policy \ + copy "docker-archive:./bundle-docker" \ + "docker://${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-nix-${{ matrix.system }}" diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml new file mode 100644 index 000000000..174165afb --- /dev/null +++ b/.github/workflows/prepare.yml @@ -0,0 +1,79 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: Prepare + +on: + workflow_call: + +env: + REGISTRY: ghcr.io + DOCKER_IMAGE: ghcr.io/${{ github.repository_owner }}/villas/node + DOCKER_TAG: ${{ github.sha }} + +permissions: + contents: read + packages: write + +jobs: + prepare-docker: + name: "prepare:docker [${{ matrix.name }}]" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - name: ubuntu + docker_file: packaging/docker/Dockerfile.ubuntu + image_name: ubuntu + - name: debian + docker_file: packaging/docker/Dockerfile.debian + image_name: debian + - name: rocky + docker_file: packaging/docker/Dockerfile.rocky + image_name: rocky + - name: rocky9 + docker_file: packaging/docker/Dockerfile.rocky9 + image_name: rocky9 + - name: fedora + docker_file: packaging/docker/Dockerfile.fedora + image_name: fedora + - name: fedora-minimal + docker_file: packaging/docker/Dockerfile.fedora-minimal + image_name: fedora-minimal + - name: fedora-vscode + docker_file: packaging/docker/Dockerfile.fedora + image_name: vscode + target: dev-vscode + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/setup-buildx-action@v3 + + - name: Build and push dev image + uses: docker/build-push-action@v6 + with: + context: . + file: ${{ matrix.docker_file }} + target: ${{ matrix.target || 'dev' }} + push: true + tags: | + ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ env.DOCKER_TAG }} + ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ github.ref_name }} + + - name: Publish fedora dev alias + if: matrix.name == 'fedora' + run: | + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}/dev:${{ env.DOCKER_TAG }}" \ + -t "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" \ + "${{ env.DOCKER_IMAGE }}/dev-fedora:${{ env.DOCKER_TAG }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..f620642f4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,172 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: Test + +on: + workflow_call: + +env: + CMAKE_BUILD_OPTS: --parallel 16 + CMAKE_OPTS: -Wno-dev -G=Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX} + +permissions: + contents: read + packages: read + +jobs: + # test-pre-commit: + # name: test:pre-commit + # runs-on: ubuntu-latest + # container: + # image: python:3.12.10-slim-bookworm + # options: --user root + # steps: + # - name: Install git + # run: apt-get update && apt-get -y install git ruby + # + # - uses: actions/checkout@v4 + # + # - name: Install dependencies + # run: + # # apt-get update && apt-get -y install git ruby + # pip install --no-cache-dir pre-commit + # + # # - name: Add Git safe directory + # # run: git config --global --add safe.directory '*' + # + # - name: Run pre-commit + # run: | + # git version + # pre-commit run --all-files + # cat /github/home/.cache/pre-commit/pre-commit.log + # + # + # - name: Upload log + # if: failure() + # uses: actions/upload-artifact@v4 + # with: + # name: pre-commit-log + # path: /github/home/.cache/pre-commit/pre-commit.log + + test-python: + name: test:python + runs-on: ubuntu-latest + container: + image: ghcr.io/${{ github.repository_owner }}/villas/node/dev-fedora:${{ github.sha }} + options: --user root + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Run Python tests + run: | + cd python + pytest --verbose . + + - name: Check formatting + run: | + cd python + black --line-length=90 --extend-exclude=".*(\.pyi|_pb2.py)$" --check . + + - name: Lint with flake8 + run: | + cd python + flake8 --max-line-length=90 --extend-exclude="*.pyi,*_pb2.py" . + + - name: Type check with mypy + run: | + cd python + mypy --namespace-packages --explicit-package-bases . + + test-cppcheck: + name: test:cppcheck + runs-on: ubuntu-latest + container: + image: ghcr.io/${{ github.repository_owner }}/villas/node/dev-fedora:${{ github.sha }} + options: --user root + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Run cppcheck + run: ./tools/run-cppcheck.sh | tee cppcheck.log + + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: cppcheck-log + path: cppcheck.log + + test-unit: + name: test:unit + runs-on: ubuntu-latest + container: + image: ghcr.io/${{ github.repository_owner }}/villas/node/dev-fedora:${{ github.sha }} + options: --user root + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Configure + run: cmake -S . -B build + + - name: Build and run unit tests + run: LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH cmake --build build ${{ env.CMAKE_BUILD_OPTS }} --target run-unit-tests run-unit-tests-common + + # test-integration: + # name: test:integration + # runs-on: ubuntu-latest + # container: + # image: ghcr.io/${{ github.repository_owner }}/villas/node/dev-fedora:${{ github.sha }} + # options: --user root + # services: + # rabbitmq: + # image: rwthacs/rabbitmq + # redis: + # image: redis:6.2 + # steps: + # - uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # submodules: recursive + # + # - name: Start mosquitto + # run: | + # echo "127.0.0.1 mosquitto" >> /etc/hosts + # cat > /tmp/mosquitto.conf <<'EOF' + # listener 1883 + # allow_anonymous true + # EOF + # mosquitto -c /tmp/mosquitto.conf -d + # + # - name: Configure + # run: | + # cmake -S . -B build --target install ${{ env.CMAKE_OPTS }} + # + # - name: Build and run integration tests + # # run: cmake --build build ${{ env.CMAKE_BUILD_OPTS }} --target run-integration-tests + # run: cmake --build build --target run-integration-tests + # - uses: actions/upload-artifact@v4 + # if: always() + # with: + # name: integration-tests + # path: build/tests/integration/ + + test-reuse: + name: test:reuse + runs-on: ubuntu-latest + container: + image: fsfe/reuse:latest + options: --entrypoint "" + steps: + - uses: actions/checkout@v4 + + - name: Run REUSE lint + run: reuse lint From 1d5034a9b5e84baad60ff3ceb02be0c35b327426 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Wed, 1 Jul 2026 13:58:33 +0200 Subject: [PATCH 02/50] fix(gh-actions): lower case Signed-off-by: Alexandra --- .github/workflows/packaging.yml | 2 +- .github/workflows/prepare.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 2095c2a33..42da0513c 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -61,7 +61,7 @@ jobs: ARCH=${{ matrix.arch }} TRIPLET=${{ matrix.triplet }} CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} - tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-${{ matrix.arch }} + tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}_${{ matrix.arch }} pkg-nix-arx: name: "pkg:nix:arx [${{ matrix.system }}]" diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index 174165afb..bdba79e1d 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -67,8 +67,8 @@ jobs: target: ${{ matrix.target || 'dev' }} push: true tags: | - ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ env.DOCKER_TAG }} - ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ github.ref_name }} + ${{ env.DOCKER_IMAGE }}/dev_${{ matrix.image_name }}:${{ env.DOCKER_TAG }} + ${{ env.DOCKER_IMAGE }}/dev_${{ matrix.image_name }}:${{ github.ref_name }} - name: Publish fedora dev alias if: matrix.name == 'fedora' @@ -76,4 +76,4 @@ jobs: docker buildx imagetools create \ -t "${{ env.DOCKER_IMAGE }}/dev:${{ env.DOCKER_TAG }}" \ -t "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" \ - "${{ env.DOCKER_IMAGE }}/dev-fedora:${{ env.DOCKER_TAG }}" + "${{ env.DOCKER_IMAGE }}/dev_fedora:${{ env.DOCKER_TAG }}" From 8562fa20ca10c873e49f483e67af5b891d9d42b4 Mon Sep 17 00:00:00 2001 From: Alexandra Date: Wed, 1 Jul 2026 14:07:24 +0200 Subject: [PATCH 03/50] fix(gh-actions): lower case of repo_owner Signed-off-by: Alexandra --- .github/workflows/build.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/packaging.yml | 4 ++-- .github/workflows/prepare.yml | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 379852306..26b5f27ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: name: "build:source [${{ matrix.distro }}]" runs-on: ubuntu-latest container: - image: ghcr.io/${{ github.repository_owner }}/villas/node/dev-${{ matrix.image_name }}:${{ github.sha }} + image: ghcr.io/${{ github.repository_owner | toLowerCase }}/villas/node/dev-${{ matrix.image_name }}:${{ github.sha }} options: --user root strategy: fail-fast: false diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 85583cff7..c256ac165 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,7 +13,7 @@ on: env: REGISTRY: ghcr.io - DOCKER_IMAGE: ghcr.io/${{ github.repository_owner }}/villas/node + DOCKER_IMAGE: ghcr.io/${{ github.repository_owner | toLowerCase }}/villas/node permissions: contents: read diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 42da0513c..6ef88390c 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -8,7 +8,7 @@ on: env: REGISTRY: ghcr.io - DOCKER_IMAGE: ghcr.io/${{ github.repository_owner }}/villas/node + DOCKER_IMAGE: ghcr.io/${{ github.repository_owner | toLowerCase }}/villas/node CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release CACHIX_CACHE_NAME: villas @@ -61,7 +61,7 @@ jobs: ARCH=${{ matrix.arch }} TRIPLET=${{ matrix.triplet }} CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} - tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}_${{ matrix.arch }} + tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-${{ matrix.arch }} pkg-nix-arx: name: "pkg:nix:arx [${{ matrix.system }}]" diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index bdba79e1d..1208ea07b 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -8,7 +8,7 @@ on: env: REGISTRY: ghcr.io - DOCKER_IMAGE: ghcr.io/${{ github.repository_owner }}/villas/node + DOCKER_IMAGE: ghcr.io/${{ github.repository_owner | toLowerCase }}/villas/node DOCKER_TAG: ${{ github.sha }} permissions: @@ -67,8 +67,8 @@ jobs: target: ${{ matrix.target || 'dev' }} push: true tags: | - ${{ env.DOCKER_IMAGE }}/dev_${{ matrix.image_name }}:${{ env.DOCKER_TAG }} - ${{ env.DOCKER_IMAGE }}/dev_${{ matrix.image_name }}:${{ github.ref_name }} + ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ env.DOCKER_TAG }} + ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ github.ref_name }} - name: Publish fedora dev alias if: matrix.name == 'fedora' @@ -76,4 +76,4 @@ jobs: docker buildx imagetools create \ -t "${{ env.DOCKER_IMAGE }}/dev:${{ env.DOCKER_TAG }}" \ -t "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" \ - "${{ env.DOCKER_IMAGE }}/dev_fedora:${{ env.DOCKER_TAG }}" + "${{ env.DOCKER_IMAGE }}/dev-fedora:${{ env.DOCKER_TAG }}" From c0cf0d9361d58bb42e55fb5d396a937f0290136b Mon Sep 17 00:00:00 2001 From: Alexandra Date: Wed, 1 Jul 2026 14:09:45 +0200 Subject: [PATCH 04/50] fix(gh-actions): lower case of villasframework Signed-off-by: Alexandra --- .github/workflows/build.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/packaging.yml | 2 +- .github/workflows/prepare.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26b5f27ed..0bea168ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: name: "build:source [${{ matrix.distro }}]" runs-on: ubuntu-latest container: - image: ghcr.io/${{ github.repository_owner | toLowerCase }}/villas/node/dev-${{ matrix.image_name }}:${{ github.sha }} + image: ghcr.io/villasframework/villas/node/dev-${{ matrix.image_name }}:${{ github.sha }} options: --user root strategy: fail-fast: false diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c256ac165..d72d8bb42 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,7 +13,7 @@ on: env: REGISTRY: ghcr.io - DOCKER_IMAGE: ghcr.io/${{ github.repository_owner | toLowerCase }}/villas/node + DOCKER_IMAGE: ghcr.io/villasframework/villas/node permissions: contents: read diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 6ef88390c..d58847fa5 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -8,7 +8,7 @@ on: env: REGISTRY: ghcr.io - DOCKER_IMAGE: ghcr.io/${{ github.repository_owner | toLowerCase }}/villas/node + DOCKER_IMAGE: ghcr.io/villasframework/villas/node CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release CACHIX_CACHE_NAME: villas diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index 1208ea07b..dad9edc0a 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -8,7 +8,7 @@ on: env: REGISTRY: ghcr.io - DOCKER_IMAGE: ghcr.io/${{ github.repository_owner | toLowerCase }}/villas/node + DOCKER_IMAGE: ghcr.io/villasframework/villas/node DOCKER_TAG: ${{ github.sha }} permissions: From 1f339cf06fe23a1654cabb616789452cb38bd85b Mon Sep 17 00:00:00 2001 From: Alexandra Date: Wed, 1 Jul 2026 14:31:45 +0200 Subject: [PATCH 05/50] fix(gh-actions): lower case of villasframework in test Signed-off-by: Alexandra --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f620642f4..5cb4a9e9d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,7 +53,7 @@ jobs: name: test:python runs-on: ubuntu-latest container: - image: ghcr.io/${{ github.repository_owner }}/villas/node/dev-fedora:${{ github.sha }} + image: ghcr.io/villasframework/villas/node/dev-fedora:${{ github.sha }} options: --user root steps: - uses: actions/checkout@v4 @@ -85,7 +85,7 @@ jobs: name: test:cppcheck runs-on: ubuntu-latest container: - image: ghcr.io/${{ github.repository_owner }}/villas/node/dev-fedora:${{ github.sha }} + image: ghcr.io/villasframework/villas/node/dev-fedora:${{ github.sha }} options: --user root steps: - uses: actions/checkout@v4 @@ -106,7 +106,7 @@ jobs: name: test:unit runs-on: ubuntu-latest container: - image: ghcr.io/${{ github.repository_owner }}/villas/node/dev-fedora:${{ github.sha }} + image: ghcr.io/villasframework/villas/node/dev-fedora:${{ github.sha }} options: --user root steps: - uses: actions/checkout@v4 @@ -124,7 +124,7 @@ jobs: # name: test:integration # runs-on: ubuntu-latest # container: - # image: ghcr.io/${{ github.repository_owner }}/villas/node/dev-fedora:${{ github.sha }} + # image: ghcr.io/villasframework/villas/node/dev-fedora:${{ github.sha }} # options: --user root # services: # rabbitmq: From cc98b7454dbe7576e629d6a2b0f9a78b8eaf7fe2 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Fri, 3 Jul 2026 14:36:45 +0200 Subject: [PATCH 06/50] Include integration tests in github actions Signed-off-by: Ritesh.K --- .github/workflows/test.yml | 78 +++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5cb4a9e9d..f6faedf27 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: env: CMAKE_BUILD_OPTS: --parallel 16 - CMAKE_OPTS: -Wno-dev -G=Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${PREFIX} + CMAKE_OPTS: -DCMAKE_INSTALL_PREFIX=${PREFIX} permissions: contents: read @@ -120,44 +120,44 @@ jobs: - name: Build and run unit tests run: LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH cmake --build build ${{ env.CMAKE_BUILD_OPTS }} --target run-unit-tests run-unit-tests-common - # test-integration: - # name: test:integration - # runs-on: ubuntu-latest - # container: - # image: ghcr.io/villasframework/villas/node/dev-fedora:${{ github.sha }} - # options: --user root - # services: - # rabbitmq: - # image: rwthacs/rabbitmq - # redis: - # image: redis:6.2 - # steps: - # - uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # submodules: recursive - # - # - name: Start mosquitto - # run: | - # echo "127.0.0.1 mosquitto" >> /etc/hosts - # cat > /tmp/mosquitto.conf <<'EOF' - # listener 1883 - # allow_anonymous true - # EOF - # mosquitto -c /tmp/mosquitto.conf -d - # - # - name: Configure - # run: | - # cmake -S . -B build --target install ${{ env.CMAKE_OPTS }} - # - # - name: Build and run integration tests - # # run: cmake --build build ${{ env.CMAKE_BUILD_OPTS }} --target run-integration-tests - # run: cmake --build build --target run-integration-tests - # - uses: actions/upload-artifact@v4 - # if: always() - # with: - # name: integration-tests - # path: build/tests/integration/ + test-integration: + name: test:integration + runs-on: ubuntu-latest + container: + image: ghcr.io/villasframework/villas/node/dev-fedora:${{ github.sha }} + options: --user root + services: + rabbitmq: + image: rwthacs/rabbitmq + redis: + image: redis:6.2 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Start mosquitto + run: | + echo "127.0.0.1 mosquitto" >> /etc/hosts + cat > /tmp/mosquitto.conf <<'EOF' + listener 1883 + allow_anonymous true + EOF + mosquitto -c /tmp/mosquitto.conf -d + + - name: Configure + run: | + cmake -S . -B build + cmake --build build --target install ${{ env.CMAKE_OPTS }} + + - name: Build and run integration tests + run: cmake --build build --target run-integration-tests + - uses: actions/upload-artifact@v4 + if: always() + with: + name: integration-tests + path: build/tests/integration/ test-reuse: name: test:reuse From 0475d0d602e2cf58a7e3a297ae97be663237134a Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Fri, 3 Jul 2026 14:59:51 +0200 Subject: [PATCH 07/50] Include integration tests in github actions Signed-off-by: Ritesh.K --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f6faedf27..d3e364990 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -149,7 +149,7 @@ jobs: - name: Configure run: | cmake -S . -B build - cmake --build build --target install ${{ env.CMAKE_OPTS }} + cmake --build build --target install - name: Build and run integration tests run: cmake --build build --target run-integration-tests From c21da2e11547283bf3c0705a5fa30545962e0164 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Sun, 5 Jul 2026 21:29:10 +0200 Subject: [PATCH 08/50] fix: Test packaging process without nix builds Signed-off-by: Ritesh.K --- .github/workflows/packaging.yml | 218 ++++++++++++++++---------------- 1 file changed, 109 insertions(+), 109 deletions(-) diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index d58847fa5..f3eee6feb 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -63,112 +63,112 @@ jobs: CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-${{ matrix.arch }} - pkg-nix-arx: - name: "pkg:nix:arx [${{ matrix.system }}]" - runs-on: ubuntu-latest - container: - image: docker.nix-community.org/nixpkgs/cachix-flakes - strategy: - fail-fast: false - matrix: - system: [x86_64-linux, aarch64-linux] - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - - name: Configure Cachix - run: cachix use "${{ env.CACHIX_CACHE_NAME }}" - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - - - name: Bundle as arx - run: | - cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - nix bundle --print-build-logs --out-link bundle-arx \ - --bundler github:nix-community/nix-bundle \ - ".#villas-node-${{ matrix.system }}" - mkdir -p artifacts - cp -L bundle-arx artifacts/villas-${{ matrix.system }} - - - uses: actions/upload-artifact@v4 - with: - name: villas-arx-${{ matrix.system }} - path: artifacts/ - retention-days: 365 - - pkg-nix-rpm: - name: "pkg:nix:rpm [${{ matrix.system }}]" - runs-on: ubuntu-latest - container: - image: docker.nix-community.org/nixpkgs/cachix-flakes - strategy: - fail-fast: false - matrix: - system: [x86_64-linux, aarch64-linux] - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - - name: Configure Cachix - run: cachix use "${{ env.CACHIX_CACHE_NAME }}" - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - - - name: Bundle as RPM - run: | - cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - nix bundle --print-build-logs --out-link bundle-rpm \ - --bundler github:NixOS/bundlers#toRPM \ - ".#villas-node-${{ matrix.system }}" - mkdir -p artifacts - cp -L bundle-rpm/*.rpm artifacts/villas-${{ matrix.system }}.rpm - - - uses: actions/upload-artifact@v4 - with: - name: villas-rpm-${{ matrix.system }} - path: artifacts/ - retention-days: 365 - - pkg-nix-docker: - name: "pkg:nix:docker [${{ matrix.system }}]" - runs-on: ubuntu-latest - container: - image: docker.nix-community.org/nixpkgs/cachix-flakes - strategy: - fail-fast: false - matrix: - system: [x86_64-linux, aarch64-linux] - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - - name: Configure Cachix - run: cachix use "${{ env.CACHIX_CACHE_NAME }}" - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - - - name: Bundle as Docker image - run: | - mkdir -p /var/tmp/ - cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - nix bundle --print-build-logs --out-link bundle-docker \ - --bundler github:NixOS/bundlers#toDockerImage \ - ".#villas-node-${{ matrix.system }}" - - - name: Push to registry - run: | - nix run nixpkgs#skopeo -- login \ - --username "${{ github.actor }}" \ - --password "${{ secrets.GITHUB_TOKEN }}" \ - "${{ env.REGISTRY }}" - nix run nixpkgs#skopeo -- \ - --tmpdir="${{ runner.temp }}" \ - --insecure-policy \ - copy "docker-archive:./bundle-docker" \ - "docker://${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-nix-${{ matrix.system }}" + # pkg-nix-arx: + # name: "pkg:nix:arx [${{ matrix.system }}]" + # runs-on: ubuntu-latest + # container: + # image: docker.nix-community.org/nixpkgs/cachix-flakes + # strategy: + # fail-fast: false + # matrix: + # system: [x86_64-linux, aarch64-linux] + # steps: + # - uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # submodules: recursive + # + # - name: Configure Cachix + # run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + # env: + # CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + # + # - name: Bundle as arx + # run: | + # cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + # nix bundle --print-build-logs --out-link bundle-arx \ + # --bundler github:nix-community/nix-bundle \ + # ".#villas-node-${{ matrix.system }}" + # mkdir -p artifacts + # cp -L bundle-arx artifacts/villas-${{ matrix.system }} + # + # - uses: actions/upload-artifact@v4 + # with: + # name: villas-arx-${{ matrix.system }} + # path: artifacts/ + # retention-days: 365 + # + # pkg-nix-rpm: + # name: "pkg:nix:rpm [${{ matrix.system }}]" + # runs-on: ubuntu-latest + # container: + # image: docker.nix-community.org/nixpkgs/cachix-flakes + # strategy: + # fail-fast: false + # matrix: + # system: [x86_64-linux, aarch64-linux] + # steps: + # - uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # submodules: recursive + # + # - name: Configure Cachix + # run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + # env: + # CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + # + # - name: Bundle as RPM + # run: | + # cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + # nix bundle --print-build-logs --out-link bundle-rpm \ + # --bundler github:NixOS/bundlers#toRPM \ + # ".#villas-node-${{ matrix.system }}" + # mkdir -p artifacts + # cp -L bundle-rpm/*.rpm artifacts/villas-${{ matrix.system }}.rpm + # + # - uses: actions/upload-artifact@v4 + # with: + # name: villas-rpm-${{ matrix.system }} + # path: artifacts/ + # retention-days: 365 + # + # pkg-nix-docker: + # name: "pkg:nix:docker [${{ matrix.system }}]" + # runs-on: ubuntu-latest + # container: + # image: docker.nix-community.org/nixpkgs/cachix-flakes + # strategy: + # fail-fast: false + # matrix: + # system: [x86_64-linux, aarch64-linux] + # steps: + # - uses: actions/checkout@v4 + # with: + # fetch-depth: 0 + # submodules: recursive + # + # - name: Configure Cachix + # run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + # env: + # CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + # + # - name: Bundle as Docker image + # run: | + # mkdir -p /var/tmp/ + # cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + # nix bundle --print-build-logs --out-link bundle-docker \ + # --bundler github:NixOS/bundlers#toDockerImage \ + # ".#villas-node-${{ matrix.system }}" + # + # - name: Push to registry + # run: | + # nix run nixpkgs#skopeo -- login \ + # --username "${{ github.actor }}" \ + # --password "${{ secrets.GITHUB_TOKEN }}" \ + # "${{ env.REGISTRY }}" + # nix run nixpkgs#skopeo -- \ + # --tmpdir="${{ runner.temp }}" \ + # --insecure-policy \ + # copy "docker-archive:./bundle-docker" \ + # "docker://${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-nix-${{ matrix.system }}" From 7c0eb3829098dab1f2bbdc79e673d422ac6ed993 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 6 Jul 2026 13:34:27 +0200 Subject: [PATCH 09/50] fix: create separate job for arm64 docker image Signed-off-by: Ritesh.K --- .github/workflows/deploy.yml | 13 ++++---- .github/workflows/packaging.yml | 53 ++++++++++++++++++++++----------- 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d72d8bb42..f7b1a8b60 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,7 +24,7 @@ jobs: name: deploy:docker runs-on: ubuntu-latest steps: - - uses: docker/login-action@v3 + - uses: docker/setup-buildx-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -32,11 +32,14 @@ jobs: - name: Create and push multi-arch manifest run: | - docker manifest rm "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" || true - docker manifest create "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" \ + # docker manifest rm "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" || true + # docker manifest create "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" \ + # "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ + # "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" + # docker manifest push "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" + docker buildx imagetools create -t ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" \ "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ - "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" - docker manifest push "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" + "${{env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" latest-docker: name: latest:docker diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index f3eee6feb..1b129e904 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -18,29 +18,16 @@ permissions: jobs: pkg-docker: - name: "pkg:docker [${{ matrix.arch }}]" + name: "pkg:docker [x86_64]" runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - include: - - distro: debian - platform: linux/amd64 - arch: x86_64 - triplet: x86_64-linux-gnu - - distro: debian - platform: linux/arm64 - arch: arm64 - triplet: aarch64-linux-gnu steps: - uses: actions/checkout@v4 with: fetch-depth: 0 submodules: recursive - - uses: docker/setup-qemu-action@v3 - if: matrix.arch != 'x86_64' - - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 @@ -56,12 +43,42 @@ jobs: target: app push: true pull: true - platforms: ${{ matrix.platform }} + platforms: amd64 build-args: | - ARCH=${{ matrix.arch }} - TRIPLET=${{ matrix.triplet }} + ARCH=x86_64 + TRIPLET=x86_64-linux-gnu CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} - tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-${{ matrix.arch }} + tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64 + pkg-docker-arm64: + name: "pkg:docker [arm64]" + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - uses: docker/build-push-action@v6 + with: + context: . + file: packaging/docker/Dockerfile.debian + target: app + push: true + pull: true + platforms: linux/arm64 + build-args: | + ARCH=arm64 + TRIPLET=aarch64-linux-gnu + CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} + tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64 # pkg-nix-arx: # name: "pkg:nix:arx [${{ matrix.system }}]" From 613d53d68c08812138f3ddba26180e69e0c7ba4b Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 6 Jul 2026 13:36:45 +0200 Subject: [PATCH 10/50] fix: fix job name Signed-off-by: Ritesh.K --- .github/workflows/packaging.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 1b129e904..cee170546 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -17,7 +17,7 @@ permissions: packages: write jobs: - pkg-docker: + pkg-docker-x86_64: name: "pkg:docker [x86_64]" runs-on: ubuntu-latest strategy: @@ -49,6 +49,7 @@ jobs: TRIPLET=x86_64-linux-gnu CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64 + pkg-docker-arm64: name: "pkg:docker [arm64]" runs-on: ubuntu-24.04-arm From 5206880e4e042954906e29acf28f038656f5fbc4 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 6 Jul 2026 13:44:24 +0200 Subject: [PATCH 11/50] fix: whitespace issue Signed-off-by: Ritesh.K --- .github/workflows/deploy.yml | 10 ++++-- .github/workflows/packaging.yml | 54 ++++++++++++++++----------------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f7b1a8b60..9594f4b52 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -44,7 +44,10 @@ jobs: latest-docker: name: latest:docker if: startsWith(github.ref, 'refs/tags/v') - needs: [deploy-docker] + needs: + - deploy-docker-x86_64 + - deplot-docker-arm64 + runs-on: ubuntu-latest steps: - uses: docker/login-action@v3 @@ -83,7 +86,10 @@ jobs: latest-docker-manual: name: latest:docker (manual) if: inputs.publish_latest - needs: [deploy-docker] + needs: + - deploy-docker-x86_64 + - deplot-docker-arm64 + runs-on: ubuntu-latest steps: - uses: docker/login-action@v3 diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index cee170546..20729d955 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -50,36 +50,36 @@ jobs: CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64 - pkg-docker-arm64: - name: "pkg:docker [arm64]" - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive + pkg-docker-arm64: + name: "pkg:docker [arm64]" + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive - - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v3 - - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/build-push-action@v6 - with: - context: . - file: packaging/docker/Dockerfile.debian - target: app - push: true - pull: true - platforms: linux/arm64 - build-args: | - ARCH=arm64 - TRIPLET=aarch64-linux-gnu - CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} - tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64 + - uses: docker/build-push-action@v6 + with: + context: . + file: packaging/docker/Dockerfile.debian + target: app + push: true + pull: true + platforms: linux/arm64 + build-args: | + ARCH=arm64 + TRIPLET=aarch64-linux-gnu + CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} + tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64 # pkg-nix-arx: # name: "pkg:nix:arx [${{ matrix.system }}]" From e5548fac19b5c517e92b41dffc87c87a42bb54f1 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 6 Jul 2026 13:46:15 +0200 Subject: [PATCH 12/50] fix: job name Signed-off-by: Ritesh.K --- .github/workflows/deploy.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9594f4b52..f7b1a8b60 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -44,10 +44,7 @@ jobs: latest-docker: name: latest:docker if: startsWith(github.ref, 'refs/tags/v') - needs: - - deploy-docker-x86_64 - - deplot-docker-arm64 - + needs: [deploy-docker] runs-on: ubuntu-latest steps: - uses: docker/login-action@v3 @@ -86,10 +83,7 @@ jobs: latest-docker-manual: name: latest:docker (manual) if: inputs.publish_latest - needs: - - deploy-docker-x86_64 - - deplot-docker-arm64 - + needs: [deploy-docker] runs-on: ubuntu-latest steps: - uses: docker/login-action@v3 From ef5fa362aa74be45445d133cc03c42a448a7885f Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 6 Jul 2026 15:20:21 +0200 Subject: [PATCH 13/50] fix: fix faulty docker file path Signed-off-by: Ritesh.K --- .github/workflows/packaging.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 20729d955..089bac212 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -11,6 +11,7 @@ env: DOCKER_IMAGE: ghcr.io/villasframework/villas/node CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release CACHIX_CACHE_NAME: villas + DOCKER_FILE: packaging/docker/Dockerfile.fedora permissions: contents: read @@ -39,7 +40,7 @@ jobs: - uses: docker/build-push-action@v6 with: context: . - file: packaging/docker/Dockerfile.${{ matrix.distro }} + file: ${{ env.DOCKER_FILE }} target: app push: true pull: true From f166670af06cb699bbd002fd3b6f738569283288 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Tue, 7 Jul 2026 13:07:45 +0200 Subject: [PATCH 14/50] fix: fix syntax in deploy.yml Signed-off-by: Ritesh.K --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f7b1a8b60..20cf77829 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -37,9 +37,9 @@ jobs: # "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ # "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" # docker manifest push "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" - docker buildx imagetools create -t ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" \ + docker buildx imagetools create -t "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" \ "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ - "${{env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" + "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" latest-docker: name: latest:docker From e24f4bf55b3a2d642b3b7e68259e3e4279fcc1be Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 13 Jul 2026 11:41:51 +0200 Subject: [PATCH 15/50] fix: fix workflow auth error in build.yml Signed-off-by: Ritesh.K --- .github/workflows/deploy.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 20cf77829..9504eb4bd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-FileCopyrightText: 2014-2026 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 name: Deploy @@ -25,6 +25,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -32,12 +34,8 @@ jobs: - name: Create and push multi-arch manifest run: | - # docker manifest rm "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" || true - # docker manifest create "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" \ - # "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ - # "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" - # docker manifest push "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" - docker buildx imagetools create -t "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" \ + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" \ "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" From 8e31781db63e2495ef5b8d6042ecb3862ec2f52f Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 13 Jul 2026 15:55:56 +0200 Subject: [PATCH 16/50] fix: Change conditions to publish docker images Signed-off-by: Ritesh.K --- .github/workflows/ci.yml | 7 ----- .github/workflows/deploy.yml | 54 ++++++++++++++++++++++++++++++------ 2 files changed, 45 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f0adc93f..59c259d04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,11 +10,6 @@ on: pull_request: branches: workflow_dispatch: - inputs: - publish_latest: - description: Publish dev and app images as latest - type: boolean - default: false concurrency: group: ci-${{ github.workflow }}-${{ github.ref }} @@ -45,6 +40,4 @@ jobs: if: github.event_name != 'pull_request' needs: [packaging] uses: ./.github/workflows/deploy.yml - with: - publish_latest: ${{ github.event_name == 'workflow_dispatch' && inputs.publish_latest || false }} secrets: inherit diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9504eb4bd..a4dc4e695 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,15 +5,11 @@ name: Deploy on: workflow_call: - inputs: - publish_latest: - required: false - type: boolean - default: false env: REGISTRY: ghcr.io DOCKER_IMAGE: ghcr.io/villasframework/villas/node + VERSION_TAG_REGEX: '^v[0-9]+(\.[0-9]+)+$' permissions: contents: read @@ -39,9 +35,45 @@ jobs: "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" + deploy-docker-dev: + name: deploy:docker-dev + runs-on: ubuntu-latest + steps: + - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish dev image for current ref + run: | + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" \ + "${{ env.DOCKER_IMAGE }}/dev-fedora:${{ github.ref_name }}" + + deploy-docker-dev-vscode: + name: deploy:docker-dev-vscode + runs-on: ubuntu-latest + steps: + - uses: docker/setup-buildx-action@v3 + + - uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish dev-vscode image for current ref + run: | + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}/dev-vscode:${{ github.ref_name }}" \ + "${{ env.DOCKER_IMAGE }}/dev-vscode:${{ github.ref_name }}" + latest-docker: name: latest:docker - if: startsWith(github.ref, 'refs/tags/v') + if: github.ref_type == 'tag' && matches(github.ref_name, env.VERSION_TAG_REGEX) needs: [deploy-docker] runs-on: ubuntu-latest steps: @@ -61,7 +93,8 @@ jobs: latest-docker-dev: name: latest:docker-dev - if: startsWith(github.ref, 'refs/tags/v') + if: github.ref_type == 'tag' && matches(github.ref_name, env.VERSION_TAG_REGEX) + needs: [deploy-docker-dev] runs-on: ubuntu-latest steps: - uses: docker/setup-buildx-action@v3 @@ -80,9 +113,10 @@ jobs: latest-docker-manual: name: latest:docker (manual) - if: inputs.publish_latest + if: github.ref_type != 'tag' || !matches(github.ref_name, env.VERSION_TAG_REGEX) needs: [deploy-docker] runs-on: ubuntu-latest + environment: latest-docker-manual steps: - uses: docker/login-action@v3 with: @@ -100,8 +134,10 @@ jobs: latest-docker-dev-manual: name: latest:docker-dev (manual) - if: inputs.publish_latest + if: github.ref_type != 'tag' || !matches(github.ref_name, env.VERSION_TAG_REGEX) + needs: [deploy-docker-dev] runs-on: ubuntu-latest + environment: latest-docker-dev-manual steps: - uses: docker/setup-buildx-action@v3 From 438390c36ff9837d80ddade18c0fe8555f7919d4 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 13 Jul 2026 17:48:55 +0200 Subject: [PATCH 17/50] fix: fix issue with env variable usage for version tag checks Signed-off-by: Ritesh.K --- .github/workflows/deploy.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a4dc4e695..1988c029a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,7 +9,6 @@ on: env: REGISTRY: ghcr.io DOCKER_IMAGE: ghcr.io/villasframework/villas/node - VERSION_TAG_REGEX: '^v[0-9]+(\.[0-9]+)+$' permissions: contents: read @@ -73,7 +72,7 @@ jobs: latest-docker: name: latest:docker - if: github.ref_type == 'tag' && matches(github.ref_name, env.VERSION_TAG_REGEX) + if: github.ref_type == 'tag' && matches(github.ref_name, '^v[0-9]+(\.[0-9]+)+$') needs: [deploy-docker] runs-on: ubuntu-latest steps: @@ -93,7 +92,7 @@ jobs: latest-docker-dev: name: latest:docker-dev - if: github.ref_type == 'tag' && matches(github.ref_name, env.VERSION_TAG_REGEX) + if: github.ref_type == 'tag' && matches(github.ref_name, '^v[0-9]+(\.[0-9]+)+$') needs: [deploy-docker-dev] runs-on: ubuntu-latest steps: @@ -113,7 +112,7 @@ jobs: latest-docker-manual: name: latest:docker (manual) - if: github.ref_type != 'tag' || !matches(github.ref_name, env.VERSION_TAG_REGEX) + if: github.ref_type != 'tag' || !matches(github.ref_name, '^v[0-9]+(\.[0-9]+)+$') needs: [deploy-docker] runs-on: ubuntu-latest environment: latest-docker-manual @@ -134,7 +133,7 @@ jobs: latest-docker-dev-manual: name: latest:docker-dev (manual) - if: github.ref_type != 'tag' || !matches(github.ref_name, env.VERSION_TAG_REGEX) + if: github.ref_type != 'tag' || !matches(github.ref_name, '^v[0-9]+(\.[0-9]+)+$') needs: [deploy-docker-dev] runs-on: ubuntu-latest environment: latest-docker-dev-manual From 65f3b26798c148f48c00e85ebac26adce615693c Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 13 Jul 2026 17:54:18 +0200 Subject: [PATCH 18/50] fix: fix issue with env variable usage for version tag checks Signed-off-by: Ritesh.K --- .github/workflows/deploy.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1988c029a..49f05f5a4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,6 +5,11 @@ name: Deploy on: workflow_call: + inputs: + is_version_tag: + required: false + type: boolean + default: false env: REGISTRY: ghcr.io @@ -72,7 +77,7 @@ jobs: latest-docker: name: latest:docker - if: github.ref_type == 'tag' && matches(github.ref_name, '^v[0-9]+(\.[0-9]+)+$') + if: inputs.is_version_tag needs: [deploy-docker] runs-on: ubuntu-latest steps: @@ -92,7 +97,7 @@ jobs: latest-docker-dev: name: latest:docker-dev - if: github.ref_type == 'tag' && matches(github.ref_name, '^v[0-9]+(\.[0-9]+)+$') + if: inputs.is_version_tag needs: [deploy-docker-dev] runs-on: ubuntu-latest steps: @@ -112,7 +117,7 @@ jobs: latest-docker-manual: name: latest:docker (manual) - if: github.ref_type != 'tag' || !matches(github.ref_name, '^v[0-9]+(\.[0-9]+)+$') + if: !inputs.is_version_tag needs: [deploy-docker] runs-on: ubuntu-latest environment: latest-docker-manual @@ -133,7 +138,7 @@ jobs: latest-docker-dev-manual: name: latest:docker-dev (manual) - if: github.ref_type != 'tag' || !matches(github.ref_name, '^v[0-9]+(\.[0-9]+)+$') + if: !inputs.is_version_tag needs: [deploy-docker-dev] runs-on: ubuntu-latest environment: latest-docker-dev-manual From 32c8507d744de415aad5ca4137a6c3c01dc9aae9 Mon Sep 17 00:00:00 2001 From: "Ritesh.K" Date: Mon, 13 Jul 2026 17:55:38 +0200 Subject: [PATCH 19/50] fix: fix issue with env variable usage for version tag checks Signed-off-by: Ritesh.K --- .github/workflows/deploy.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 49f05f5a4..c4ef6b68e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -77,7 +77,7 @@ jobs: latest-docker: name: latest:docker - if: inputs.is_version_tag + if: ${{ inputs.is_version_tag }} needs: [deploy-docker] runs-on: ubuntu-latest steps: @@ -97,7 +97,7 @@ jobs: latest-docker-dev: name: latest:docker-dev - if: inputs.is_version_tag + if: ${{ inputs.is_version_tag }} needs: [deploy-docker-dev] runs-on: ubuntu-latest steps: @@ -117,7 +117,7 @@ jobs: latest-docker-manual: name: latest:docker (manual) - if: !inputs.is_version_tag + if: ${{ !inputs.is_version_tag }} needs: [deploy-docker] runs-on: ubuntu-latest environment: latest-docker-manual @@ -138,7 +138,7 @@ jobs: latest-docker-dev-manual: name: latest:docker-dev (manual) - if: !inputs.is_version_tag + if: ${{ !inputs.is_version_tag }} needs: [deploy-docker-dev] runs-on: ubuntu-latest environment: latest-docker-dev-manual From 604a45392e102ae1e896d1efdf8d86eaafbc9ac5 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 16:08:32 +0200 Subject: [PATCH 20/50] ci(docker): sanitize PR ref tags and use imagetools for latest Signed-off-by: Leonardo Carreras --- .github/workflows/deploy.yml | 14 ++++++++------ .github/workflows/prepare.yml | 8 ++++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c4ef6b68e..e9c365fa7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -81,6 +81,8 @@ jobs: needs: [deploy-docker] runs-on: ubuntu-latest steps: + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -89,11 +91,10 @@ jobs: - name: Tag and push app image as latest run: | - docker manifest rm "${{ env.DOCKER_IMAGE }}:latest" || true - docker manifest create "${{ env.DOCKER_IMAGE }}:latest" \ + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}:latest" \ "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" - docker manifest push "${{ env.DOCKER_IMAGE }}:latest" latest-docker-dev: name: latest:docker-dev @@ -122,6 +123,8 @@ jobs: runs-on: ubuntu-latest environment: latest-docker-manual steps: + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} @@ -130,11 +133,10 @@ jobs: - name: Tag and push app image as latest (manual) run: | - docker manifest rm "${{ env.DOCKER_IMAGE }}:latest" || true - docker manifest create "${{ env.DOCKER_IMAGE }}:latest" \ + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}:latest" \ "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" - docker manifest push "${{ env.DOCKER_IMAGE }}:latest" latest-docker-dev-manual: name: latest:docker-dev (manual) diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index dad9edc0a..b47c28b7c 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -59,6 +59,10 @@ jobs: - uses: docker/setup-buildx-action@v3 + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - name: Build and push dev image uses: docker/build-push-action@v6 with: @@ -68,12 +72,12 @@ jobs: push: true tags: | ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ env.DOCKER_TAG }} - ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ github.ref_name }} + ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ steps.ref.outputs.tag }} - name: Publish fedora dev alias if: matrix.name == 'fedora' run: | docker buildx imagetools create \ -t "${{ env.DOCKER_IMAGE }}/dev:${{ env.DOCKER_TAG }}" \ - -t "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" \ + -t "${{ env.DOCKER_IMAGE }}/dev:${{ steps.ref.outputs.tag }}" \ "${{ env.DOCKER_IMAGE }}/dev-fedora:${{ env.DOCKER_TAG }}" From b9081d6dbe01b28e62027289f2c8b5daac585aed Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 17:12:05 +0200 Subject: [PATCH 21/50] ci: activate nix build and packaging jobs Signed-off-by: Leonardo Carreras --- .github/workflows/build.yml | 48 +++---- .github/workflows/packaging.yml | 218 ++++++++++++++++---------------- 2 files changed, 133 insertions(+), 133 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0bea168ed..40e6a254d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,30 +75,30 @@ jobs: path: build/ retention-days: 7 - # build-nix: - # name: "build:nix [${{ matrix.system }}]" - # runs-on: ubuntu-latest - # container: - # image: docker.nix-community.org/nixpkgs/cachix-flakes - # strategy: - # fail-fast: false - # matrix: - # system: [x86_64-linux, aarch64-linux] - # steps: - # - uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # submodules: recursive - # - # - name: Configure Cachix - # run: cachix use "${{ env.CACHIX_CACHE_NAME }}" - # env: - # CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - # - # - name: Build - # run: | - # cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - # nix build --print-build-logs ".#villas-node-${{ matrix.system }}" + build-nix: + name: "build:nix [${{ matrix.system }}]" + runs-on: ubuntu-latest + container: + image: docker.nix-community.org/nixpkgs/cachix-flakes + env: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + strategy: + fail-fast: false + matrix: + system: [x86_64-linux, aarch64-linux] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Configure Cachix + run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + + - name: Build + run: | + cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + nix build --print-build-logs ".#villas-node-${{ matrix.system }}" build-openapi: name: build:openapi diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 089bac212..34d3555d9 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -82,112 +82,112 @@ jobs: CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64 - # pkg-nix-arx: - # name: "pkg:nix:arx [${{ matrix.system }}]" - # runs-on: ubuntu-latest - # container: - # image: docker.nix-community.org/nixpkgs/cachix-flakes - # strategy: - # fail-fast: false - # matrix: - # system: [x86_64-linux, aarch64-linux] - # steps: - # - uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # submodules: recursive - # - # - name: Configure Cachix - # run: cachix use "${{ env.CACHIX_CACHE_NAME }}" - # env: - # CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - # - # - name: Bundle as arx - # run: | - # cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - # nix bundle --print-build-logs --out-link bundle-arx \ - # --bundler github:nix-community/nix-bundle \ - # ".#villas-node-${{ matrix.system }}" - # mkdir -p artifacts - # cp -L bundle-arx artifacts/villas-${{ matrix.system }} - # - # - uses: actions/upload-artifact@v4 - # with: - # name: villas-arx-${{ matrix.system }} - # path: artifacts/ - # retention-days: 365 - # - # pkg-nix-rpm: - # name: "pkg:nix:rpm [${{ matrix.system }}]" - # runs-on: ubuntu-latest - # container: - # image: docker.nix-community.org/nixpkgs/cachix-flakes - # strategy: - # fail-fast: false - # matrix: - # system: [x86_64-linux, aarch64-linux] - # steps: - # - uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # submodules: recursive - # - # - name: Configure Cachix - # run: cachix use "${{ env.CACHIX_CACHE_NAME }}" - # env: - # CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - # - # - name: Bundle as RPM - # run: | - # cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - # nix bundle --print-build-logs --out-link bundle-rpm \ - # --bundler github:NixOS/bundlers#toRPM \ - # ".#villas-node-${{ matrix.system }}" - # mkdir -p artifacts - # cp -L bundle-rpm/*.rpm artifacts/villas-${{ matrix.system }}.rpm - # - # - uses: actions/upload-artifact@v4 - # with: - # name: villas-rpm-${{ matrix.system }} - # path: artifacts/ - # retention-days: 365 - # - # pkg-nix-docker: - # name: "pkg:nix:docker [${{ matrix.system }}]" - # runs-on: ubuntu-latest - # container: - # image: docker.nix-community.org/nixpkgs/cachix-flakes - # strategy: - # fail-fast: false - # matrix: - # system: [x86_64-linux, aarch64-linux] - # steps: - # - uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # submodules: recursive - # - # - name: Configure Cachix - # run: cachix use "${{ env.CACHIX_CACHE_NAME }}" - # env: - # CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - # - # - name: Bundle as Docker image - # run: | - # mkdir -p /var/tmp/ - # cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - # nix bundle --print-build-logs --out-link bundle-docker \ - # --bundler github:NixOS/bundlers#toDockerImage \ - # ".#villas-node-${{ matrix.system }}" - # - # - name: Push to registry - # run: | - # nix run nixpkgs#skopeo -- login \ - # --username "${{ github.actor }}" \ - # --password "${{ secrets.GITHUB_TOKEN }}" \ - # "${{ env.REGISTRY }}" - # nix run nixpkgs#skopeo -- \ - # --tmpdir="${{ runner.temp }}" \ - # --insecure-policy \ - # copy "docker-archive:./bundle-docker" \ - # "docker://${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-nix-${{ matrix.system }}" + pkg-nix-arx: + name: "pkg:nix:arx [${{ matrix.system }}]" + runs-on: ubuntu-latest + container: + image: docker.nix-community.org/nixpkgs/cachix-flakes + env: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + strategy: + fail-fast: false + matrix: + system: [x86_64-linux, aarch64-linux] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Configure Cachix + run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + + - name: Bundle as arx + run: | + cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + nix bundle --print-build-logs --out-link bundle-arx \ + --bundler github:nix-community/nix-bundle \ + ".#villas-node-${{ matrix.system }}" + mkdir -p artifacts + cp -L bundle-arx artifacts/villas-${{ matrix.system }} + + - uses: actions/upload-artifact@v4 + with: + name: villas-arx-${{ matrix.system }} + path: artifacts/ + retention-days: 365 + + pkg-nix-rpm: + name: "pkg:nix:rpm [${{ matrix.system }}]" + runs-on: ubuntu-latest + container: + image: docker.nix-community.org/nixpkgs/cachix-flakes + env: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + strategy: + fail-fast: false + matrix: + system: [x86_64-linux, aarch64-linux] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Configure Cachix + run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + + - name: Bundle as RPM + run: | + cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + nix bundle --print-build-logs --out-link bundle-rpm \ + --bundler github:NixOS/bundlers#toRPM \ + ".#villas-node-${{ matrix.system }}" + mkdir -p artifacts + cp -L bundle-rpm/*.rpm artifacts/villas-${{ matrix.system }}.rpm + + - uses: actions/upload-artifact@v4 + with: + name: villas-rpm-${{ matrix.system }} + path: artifacts/ + retention-days: 365 + + pkg-nix-docker: + name: "pkg:nix:docker [${{ matrix.system }}]" + runs-on: ubuntu-latest + container: + image: docker.nix-community.org/nixpkgs/cachix-flakes + env: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + strategy: + fail-fast: false + matrix: + system: [x86_64-linux, aarch64-linux] + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Configure Cachix + run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + + - name: Bundle as Docker image + run: | + mkdir -p /var/tmp/ + cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + nix bundle --print-build-logs --out-link bundle-docker \ + --bundler github:NixOS/bundlers#toDockerImage \ + ".#villas-node-${{ matrix.system }}" + + - name: Push to registry + run: | + nix run nixpkgs#skopeo -- login \ + --username "${{ github.actor }}" \ + --password "${{ secrets.GITHUB_TOKEN }}" \ + "${{ env.REGISTRY }}" + nix run nixpkgs#skopeo -- \ + --tmpdir="${{ runner.temp }}" \ + --insecure-policy \ + copy "docker-archive:./bundle-docker" \ + "docker://${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-nix-${{ matrix.system }}" From 7d4821fb3a8bf2b1f2b23a6a5f4c7c1eb9b0bf9b Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 17:13:29 +0200 Subject: [PATCH 22/50] ci: activate pre-commit test job Signed-off-by: Leonardo Carreras --- .github/workflows/test.yml | 60 +++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 33 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3e364990..1807d3b43 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,39 +15,33 @@ permissions: packages: read jobs: - # test-pre-commit: - # name: test:pre-commit - # runs-on: ubuntu-latest - # container: - # image: python:3.12.10-slim-bookworm - # options: --user root - # steps: - # - name: Install git - # run: apt-get update && apt-get -y install git ruby - # - # - uses: actions/checkout@v4 - # - # - name: Install dependencies - # run: - # # apt-get update && apt-get -y install git ruby - # pip install --no-cache-dir pre-commit - # - # # - name: Add Git safe directory - # # run: git config --global --add safe.directory '*' - # - # - name: Run pre-commit - # run: | - # git version - # pre-commit run --all-files - # cat /github/home/.cache/pre-commit/pre-commit.log - # - # - # - name: Upload log - # if: failure() - # uses: actions/upload-artifact@v4 - # with: - # name: pre-commit-log - # path: /github/home/.cache/pre-commit/pre-commit.log + test-pre-commit: + name: test:pre-commit + runs-on: ubuntu-latest + container: + image: python:3.12.10-slim-bookworm + options: --user root + steps: + - name: Install git and ruby + run: apt-get update && apt-get -y install git ruby + + - uses: actions/checkout@v4 + + - name: Add Git safe directory + run: git config --global --add safe.directory '*' + + - name: Install pre-commit + run: pip install --no-cache-dir pre-commit + + - name: Run pre-commit + run: pre-commit run --all-files + + - name: Upload log + if: failure() + uses: actions/upload-artifact@v4 + with: + name: pre-commit-log + path: /github/home/.cache/pre-commit/pre-commit.log test-python: name: test:python From 0777b6f2b57be495ba53a5f20c856faf02abe9bc Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 17:19:27 +0200 Subject: [PATCH 23/50] ci: cancel in-progress runs per PR Signed-off-by: Leonardo Carreras --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 59c259d04..b57e7fb4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ on: workflow_dispatch: concurrency: - group: ci-${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: From c9f324d03e07e701cf488d92bcf12a69c4ff87f6 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 17:23:08 +0200 Subject: [PATCH 24/50] ci: run push only on master and tags to avoid duplicate PR runs Signed-off-by: Leonardo Carreras --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b57e7fb4b..2e1e4c8d1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,10 +5,9 @@ name: CI on: push: - branches: - tags: + branches: [master] + tags: ['v*'] pull_request: - branches: workflow_dispatch: concurrency: From dbaa53447f8f4add06bfc897fa554966271f4b24 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 17:29:03 +0200 Subject: [PATCH 25/50] ci: derive image name from repository owner so forks push to their own registry Signed-off-by: Leonardo Carreras --- .github/workflows/build.yml | 6 +++++- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++---- .github/workflows/deploy.yml | 5 ++++- .github/workflows/packaging.yml | 6 +++++- .github/workflows/prepare.yml | 6 +++++- .github/workflows/test.yml | 12 ++++++++---- 6 files changed, 54 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40e6a254d..de38cacf9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,6 +5,10 @@ name: Build on: workflow_call: + inputs: + docker_image: + required: true + type: string env: CMAKE_BUILD_OPTS: --parallel 16 @@ -20,7 +24,7 @@ jobs: name: "build:source [${{ matrix.distro }}]" runs-on: ubuntu-latest container: - image: ghcr.io/villasframework/villas/node/dev-${{ matrix.image_name }}:${{ github.sha }} + image: ${{ inputs.docker_image }}/dev-${{ matrix.image_name }}:${{ github.sha }} options: --user root strategy: fail-fast: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e1e4c8d1..e83b09cfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,28 +15,51 @@ concurrency: cancel-in-progress: true jobs: + setup: + name: setup + runs-on: ubuntu-latest + outputs: + docker_image: ${{ steps.image.outputs.docker_image }} + steps: + - name: Compute image name for the current repository + id: image + env: + OWNER: ${{ github.repository_owner }} + run: echo "docker_image=ghcr.io/${OWNER,,}/villas/node" >> "$GITHUB_OUTPUT" + prepare: + needs: [setup] uses: ./.github/workflows/prepare.yml + with: + docker_image: ${{ needs.setup.outputs.docker_image }} secrets: inherit build: - needs: [prepare] + needs: [setup, prepare] uses: ./.github/workflows/build.yml + with: + docker_image: ${{ needs.setup.outputs.docker_image }} secrets: inherit test: - needs: [build] + needs: [setup, build] uses: ./.github/workflows/test.yml + with: + docker_image: ${{ needs.setup.outputs.docker_image }} secrets: inherit packaging: if: github.event_name != 'pull_request' - needs: [test] + needs: [setup, test] uses: ./.github/workflows/packaging.yml + with: + docker_image: ${{ needs.setup.outputs.docker_image }} secrets: inherit deploy: if: github.event_name != 'pull_request' - needs: [packaging] + needs: [setup, packaging] uses: ./.github/workflows/deploy.yml + with: + docker_image: ${{ needs.setup.outputs.docker_image }} secrets: inherit diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e9c365fa7..202e4f702 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,6 +6,9 @@ name: Deploy on: workflow_call: inputs: + docker_image: + required: true + type: string is_version_tag: required: false type: boolean @@ -13,7 +16,7 @@ on: env: REGISTRY: ghcr.io - DOCKER_IMAGE: ghcr.io/villasframework/villas/node + DOCKER_IMAGE: ${{ inputs.docker_image }} permissions: contents: read diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 34d3555d9..314983ebf 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -5,10 +5,14 @@ name: Packaging on: workflow_call: + inputs: + docker_image: + required: true + type: string env: REGISTRY: ghcr.io - DOCKER_IMAGE: ghcr.io/villasframework/villas/node + DOCKER_IMAGE: ${{ inputs.docker_image }} CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release CACHIX_CACHE_NAME: villas DOCKER_FILE: packaging/docker/Dockerfile.fedora diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index b47c28b7c..b361200f8 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -5,10 +5,14 @@ name: Prepare on: workflow_call: + inputs: + docker_image: + required: true + type: string env: REGISTRY: ghcr.io - DOCKER_IMAGE: ghcr.io/villasframework/villas/node + DOCKER_IMAGE: ${{ inputs.docker_image }} DOCKER_TAG: ${{ github.sha }} permissions: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1807d3b43..b157248dc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,10 @@ name: Test on: workflow_call: + inputs: + docker_image: + required: true + type: string env: CMAKE_BUILD_OPTS: --parallel 16 @@ -47,7 +51,7 @@ jobs: name: test:python runs-on: ubuntu-latest container: - image: ghcr.io/villasframework/villas/node/dev-fedora:${{ github.sha }} + image: ${{ inputs.docker_image }}/dev-fedora:${{ github.sha }} options: --user root steps: - uses: actions/checkout@v4 @@ -79,7 +83,7 @@ jobs: name: test:cppcheck runs-on: ubuntu-latest container: - image: ghcr.io/villasframework/villas/node/dev-fedora:${{ github.sha }} + image: ${{ inputs.docker_image }}/dev-fedora:${{ github.sha }} options: --user root steps: - uses: actions/checkout@v4 @@ -100,7 +104,7 @@ jobs: name: test:unit runs-on: ubuntu-latest container: - image: ghcr.io/villasframework/villas/node/dev-fedora:${{ github.sha }} + image: ${{ inputs.docker_image }}/dev-fedora:${{ github.sha }} options: --user root steps: - uses: actions/checkout@v4 @@ -118,7 +122,7 @@ jobs: name: test:integration runs-on: ubuntu-latest container: - image: ghcr.io/villasframework/villas/node/dev-fedora:${{ github.sha }} + image: ${{ inputs.docker_image }}/dev-fedora:${{ github.sha }} options: --user root services: rabbitmq: From 91bac2982f941785c7f8ffb95c74f7b597879b93 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 17:35:45 +0200 Subject: [PATCH 26/50] ci: update actions to latest majors (drop deprecated Node 20) Signed-off-by: Leonardo Carreras --- .github/workflows/build.yml | 10 +++++----- .github/workflows/deploy.yml | 28 ++++++++++++++-------------- .github/workflows/packaging.yml | 26 +++++++++++++------------- .github/workflows/paper.yaml | 4 ++-- .github/workflows/prepare.yml | 8 ++++---- .github/workflows/test.yml | 18 +++++++++--------- 6 files changed, 47 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index de38cacf9..d2bec03c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,7 @@ jobs: - distro: ubuntu image_name: ubuntu steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive @@ -73,7 +73,7 @@ jobs: - name: Build run: cmake --build build ${{ env.CMAKE_BUILD_OPTS }} - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: build-${{ matrix.distro }} path: build/ @@ -91,7 +91,7 @@ jobs: matrix: system: [x86_64-linux, aarch64-linux] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive @@ -110,7 +110,7 @@ jobs: container: image: node:24-alpine steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Lint OpenAPI spec run: npx -y @redocly/cli lint --config doc/redocly.yaml doc/openapi/openapi.yaml @@ -118,7 +118,7 @@ jobs: - name: Build OpenAPI docs run: npx -y @redocly/cli build-docs --config doc/redocly.yaml doc/openapi/openapi.yaml --output openapi.html - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: openapi path: openapi.html diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 202e4f702..8d090f3cc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -27,9 +27,9 @@ jobs: name: deploy:docker runs-on: ubuntu-latest steps: - - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v4 - - uses: docker/login-action@v3 + - uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -46,9 +46,9 @@ jobs: name: deploy:docker-dev runs-on: ubuntu-latest steps: - - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v4 - - uses: docker/login-action@v3 + - uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -64,9 +64,9 @@ jobs: name: deploy:docker-dev-vscode runs-on: ubuntu-latest steps: - - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v4 - - uses: docker/login-action@v3 + - uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -84,9 +84,9 @@ jobs: needs: [deploy-docker] runs-on: ubuntu-latest steps: - - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v4 - - uses: docker/login-action@v3 + - uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -105,9 +105,9 @@ jobs: needs: [deploy-docker-dev] runs-on: ubuntu-latest steps: - - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v4 - - uses: docker/login-action@v3 + - uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -126,9 +126,9 @@ jobs: runs-on: ubuntu-latest environment: latest-docker-manual steps: - - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v4 - - uses: docker/login-action@v3 + - uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -148,9 +148,9 @@ jobs: runs-on: ubuntu-latest environment: latest-docker-dev-manual steps: - - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v4 - - uses: docker/login-action@v3 + - uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 314983ebf..1ac1a6200 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -28,20 +28,20 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive - - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v4 - - uses: docker/login-action@v3 + - uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/build-push-action@v6 + - uses: docker/build-push-action@v7 with: context: . file: ${{ env.DOCKER_FILE }} @@ -59,20 +59,20 @@ jobs: name: "pkg:docker [arm64]" runs-on: ubuntu-24.04-arm steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive - - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v4 - - uses: docker/login-action@v3 + - uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/build-push-action@v6 + - uses: docker/build-push-action@v7 with: context: . file: packaging/docker/Dockerfile.debian @@ -98,7 +98,7 @@ jobs: matrix: system: [x86_64-linux, aarch64-linux] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive @@ -115,7 +115,7 @@ jobs: mkdir -p artifacts cp -L bundle-arx artifacts/villas-${{ matrix.system }} - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: villas-arx-${{ matrix.system }} path: artifacts/ @@ -133,7 +133,7 @@ jobs: matrix: system: [x86_64-linux, aarch64-linux] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive @@ -150,7 +150,7 @@ jobs: mkdir -p artifacts cp -L bundle-rpm/*.rpm artifacts/villas-${{ matrix.system }}.rpm - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 with: name: villas-rpm-${{ matrix.system }} path: artifacts/ @@ -168,7 +168,7 @@ jobs: matrix: system: [x86_64-linux, aarch64-linux] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive diff --git a/.github/workflows/paper.yaml b/.github/workflows/paper.yaml index 8a0981a28..b3f9aad34 100644 --- a/.github/workflows/paper.yaml +++ b/.github/workflows/paper.yaml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Build draft PDF uses: openjournals/openjournals-draft-action@v1.0 @@ -26,7 +26,7 @@ jobs: paper-path: paper/paper.md - name: Upload - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: paper path: paper/paper.pdf diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index b361200f8..3fbb72d5a 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -50,25 +50,25 @@ jobs: image_name: vscode target: dev-vscode steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive - - uses: docker/login-action@v3 + - uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v4 - name: Compute safe ref tag id: ref run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" - name: Build and push dev image - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v7 with: context: . file: ${{ matrix.docker_file }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b157248dc..8eac45e69 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: - name: Install git and ruby run: apt-get update && apt-get -y install git ruby - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Add Git safe directory run: git config --global --add safe.directory '*' @@ -42,7 +42,7 @@ jobs: - name: Upload log if: failure() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: pre-commit-log path: /github/home/.cache/pre-commit/pre-commit.log @@ -54,7 +54,7 @@ jobs: image: ${{ inputs.docker_image }}/dev-fedora:${{ github.sha }} options: --user root steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive @@ -86,7 +86,7 @@ jobs: image: ${{ inputs.docker_image }}/dev-fedora:${{ github.sha }} options: --user root steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive @@ -94,7 +94,7 @@ jobs: - name: Run cppcheck run: ./tools/run-cppcheck.sh | tee cppcheck.log - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 if: failure() with: name: cppcheck-log @@ -107,7 +107,7 @@ jobs: image: ${{ inputs.docker_image }}/dev-fedora:${{ github.sha }} options: --user root steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive @@ -130,7 +130,7 @@ jobs: redis: image: redis:6.2 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: fetch-depth: 0 submodules: recursive @@ -151,7 +151,7 @@ jobs: - name: Build and run integration tests run: cmake --build build --target run-integration-tests - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v7 if: always() with: name: integration-tests @@ -164,7 +164,7 @@ jobs: image: fsfe/reuse:latest options: --entrypoint "" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Run REUSE lint run: reuse lint From 9bd8d0add7e231260ac41f6f9f8f95c2cdfdffeb Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 17:41:04 +0200 Subject: [PATCH 27/50] ci: skip dev image rebuild when content unchanged (always rebuild on master) Signed-off-by: Leonardo Carreras --- .github/workflows/prepare.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index 3fbb72d5a..588ede226 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -67,7 +67,25 @@ jobs: id: ref run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - name: Compute image content hash + id: hash + run: echo "tag=${{ hashFiles(matrix.docker_file, 'packaging/deps.sh', 'packaging/patches/**', 'python/**') }}" >> "$GITHUB_OUTPUT" + + - name: Check for an already-built image + id: existing + run: | + # Always rebuild on master; otherwise reuse an identical image if it exists. + if [ "${{ github.ref_name }}" = "master" ]; then + echo "exists=false" >> "$GITHUB_OUTPUT" + elif docker buildx imagetools inspect \ + "${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ steps.hash.outputs.tag }}" >/dev/null 2>&1; then + echo "exists=true" >> "$GITHUB_OUTPUT" + else + echo "exists=false" >> "$GITHUB_OUTPUT" + fi + - name: Build and push dev image + if: steps.existing.outputs.exists != 'true' uses: docker/build-push-action@v7 with: context: . @@ -75,9 +93,18 @@ jobs: target: ${{ matrix.target || 'dev' }} push: true tags: | + ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ steps.hash.outputs.tag }} ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ env.DOCKER_TAG }} ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ steps.ref.outputs.tag }} + - name: Tag existing image for this commit + if: steps.existing.outputs.exists == 'true' + run: | + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ env.DOCKER_TAG }}" \ + -t "${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ steps.ref.outputs.tag }}" \ + "${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ steps.hash.outputs.tag }}" + - name: Publish fedora dev alias if: matrix.name == 'fedora' run: | From 7b6cbd2b4777818182305b34be08444fe97d2f8e Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 17:45:24 +0200 Subject: [PATCH 28/50] ci: make cachix cache name configurable per repository Signed-off-by: Leonardo Carreras --- .github/workflows/build.yml | 2 +- .github/workflows/packaging.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2bec03c2..a3e730d39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ on: env: CMAKE_BUILD_OPTS: --parallel 16 CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release - CACHIX_CACHE_NAME: villas + CACHIX_CACHE_NAME: ${{ vars.CACHIX_CACHE_NAME || 'villas' }} permissions: contents: read diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 1ac1a6200..52b6b89ed 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -14,7 +14,7 @@ env: REGISTRY: ghcr.io DOCKER_IMAGE: ${{ inputs.docker_image }} CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release - CACHIX_CACHE_NAME: villas + CACHIX_CACHE_NAME: ${{ vars.CACHIX_CACHE_NAME || 'villas' }} DOCKER_FILE: packaging/docker/Dockerfile.fedora permissions: From 0802ec87cd7664abf62cc1be97a05763df148e00 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 17:59:50 +0200 Subject: [PATCH 29/50] ci: split prepare-independent jobs into parallel checks workflow Signed-off-by: Leonardo Carreras --- .github/workflows/build.yml | 45 ----------------- .github/workflows/checks.yml | 98 ++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 4 ++ .github/workflows/test.yml | 40 --------------- 4 files changed, 102 insertions(+), 85 deletions(-) create mode 100644 .github/workflows/checks.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3e730d39..e3bf3535f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,6 @@ on: env: CMAKE_BUILD_OPTS: --parallel 16 CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release - CACHIX_CACHE_NAME: ${{ vars.CACHIX_CACHE_NAME || 'villas' }} permissions: contents: read @@ -78,47 +77,3 @@ jobs: name: build-${{ matrix.distro }} path: build/ retention-days: 7 - - build-nix: - name: "build:nix [${{ matrix.system }}]" - runs-on: ubuntu-latest - container: - image: docker.nix-community.org/nixpkgs/cachix-flakes - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - strategy: - fail-fast: false - matrix: - system: [x86_64-linux, aarch64-linux] - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 0 - submodules: recursive - - - name: Configure Cachix - run: cachix use "${{ env.CACHIX_CACHE_NAME }}" - - - name: Build - run: | - cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - nix build --print-build-logs ".#villas-node-${{ matrix.system }}" - - build-openapi: - name: build:openapi - runs-on: ubuntu-latest - container: - image: node:24-alpine - steps: - - uses: actions/checkout@v7 - - - name: Lint OpenAPI spec - run: npx -y @redocly/cli lint --config doc/redocly.yaml doc/openapi/openapi.yaml - - - name: Build OpenAPI docs - run: npx -y @redocly/cli build-docs --config doc/redocly.yaml doc/openapi/openapi.yaml --output openapi.html - - - uses: actions/upload-artifact@v7 - with: - name: openapi - path: openapi.html diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 000000000..3fe81722c --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,98 @@ +# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: Checks + +on: + workflow_call: + +env: + CACHIX_CACHE_NAME: ${{ vars.CACHIX_CACHE_NAME || 'villas' }} + +permissions: + contents: read + +jobs: + build-nix: + name: "build:nix [${{ matrix.system }}]" + runs-on: ubuntu-latest + container: + image: docker.nix-community.org/nixpkgs/cachix-flakes + env: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + strategy: + fail-fast: false + matrix: + system: [x86_64-linux, aarch64-linux] + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + submodules: recursive + + - name: Configure Cachix + run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + + - name: Build + run: | + cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ + nix build --print-build-logs ".#villas-node-${{ matrix.system }}" + + build-openapi: + name: build:openapi + runs-on: ubuntu-latest + container: + image: node:24-alpine + steps: + - uses: actions/checkout@v7 + + - name: Lint OpenAPI spec + run: npx -y @redocly/cli lint --config doc/redocly.yaml doc/openapi/openapi.yaml + + - name: Build OpenAPI docs + run: npx -y @redocly/cli build-docs --config doc/redocly.yaml doc/openapi/openapi.yaml --output openapi.html + + - uses: actions/upload-artifact@v7 + with: + name: openapi + path: openapi.html + + pre-commit: + name: test:pre-commit + runs-on: ubuntu-latest + container: + image: python:3.12.10-slim-bookworm + options: --user root + steps: + - name: Install git and ruby + run: apt-get update && apt-get -y install git ruby + + - uses: actions/checkout@v7 + + - name: Add Git safe directory + run: git config --global --add safe.directory '*' + + - name: Install pre-commit + run: pip install --no-cache-dir pre-commit + + - name: Run pre-commit + run: pre-commit run --all-files + + - name: Upload log + if: failure() + uses: actions/upload-artifact@v7 + with: + name: pre-commit-log + path: /github/home/.cache/pre-commit/pre-commit.log + + reuse: + name: test:reuse + runs-on: ubuntu-latest + container: + image: fsfe/reuse:latest + options: --entrypoint "" + steps: + - uses: actions/checkout@v7 + + - name: Run REUSE lint + run: reuse lint diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e83b09cfa..dd01836de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,10 @@ jobs: OWNER: ${{ github.repository_owner }} run: echo "docker_image=ghcr.io/${OWNER,,}/villas/node" >> "$GITHUB_OUTPUT" + checks: + uses: ./.github/workflows/checks.yml + secrets: inherit + prepare: needs: [setup] uses: ./.github/workflows/prepare.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8eac45e69..c6076c82a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,34 +19,6 @@ permissions: packages: read jobs: - test-pre-commit: - name: test:pre-commit - runs-on: ubuntu-latest - container: - image: python:3.12.10-slim-bookworm - options: --user root - steps: - - name: Install git and ruby - run: apt-get update && apt-get -y install git ruby - - - uses: actions/checkout@v7 - - - name: Add Git safe directory - run: git config --global --add safe.directory '*' - - - name: Install pre-commit - run: pip install --no-cache-dir pre-commit - - - name: Run pre-commit - run: pre-commit run --all-files - - - name: Upload log - if: failure() - uses: actions/upload-artifact@v7 - with: - name: pre-commit-log - path: /github/home/.cache/pre-commit/pre-commit.log - test-python: name: test:python runs-on: ubuntu-latest @@ -156,15 +128,3 @@ jobs: with: name: integration-tests path: build/tests/integration/ - - test-reuse: - name: test:reuse - runs-on: ubuntu-latest - container: - image: fsfe/reuse:latest - options: --entrypoint "" - steps: - - uses: actions/checkout@v7 - - - name: Run REUSE lint - run: reuse lint From 3e9cd6aa828764727fb5f004e3171d64e103eaf9 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 18:05:00 +0200 Subject: [PATCH 30/50] ci: run nix jobs on runner with install-nix/cachix actions Signed-off-by: Leonardo Carreras --- .github/workflows/checks.yml | 16 +++++------- .github/workflows/packaging.yml | 45 +++++++++++++++------------------ 2 files changed, 28 insertions(+), 33 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 3fe81722c..32133b683 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -16,10 +16,6 @@ jobs: build-nix: name: "build:nix [${{ matrix.system }}]" runs-on: ubuntu-latest - container: - image: docker.nix-community.org/nixpkgs/cachix-flakes - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} strategy: fail-fast: false matrix: @@ -30,13 +26,15 @@ jobs: fetch-depth: 0 submodules: recursive - - name: Configure Cachix - run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + - uses: cachix/install-nix-action@v31 + + - uses: cachix/cachix-action@v17 + with: + name: ${{ env.CACHIX_CACHE_NAME }} + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Build - run: | - cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - nix build --print-build-logs ".#villas-node-${{ matrix.system }}" + run: nix build --print-build-logs ".#villas-node-${{ matrix.system }}" build-openapi: name: build:openapi diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 52b6b89ed..02979fc91 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -89,10 +89,6 @@ jobs: pkg-nix-arx: name: "pkg:nix:arx [${{ matrix.system }}]" runs-on: ubuntu-latest - container: - image: docker.nix-community.org/nixpkgs/cachix-flakes - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} strategy: fail-fast: false matrix: @@ -103,13 +99,16 @@ jobs: fetch-depth: 0 submodules: recursive - - name: Configure Cachix - run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + - uses: cachix/install-nix-action@v31 + + - uses: cachix/cachix-action@v17 + with: + name: ${{ env.CACHIX_CACHE_NAME }} + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Bundle as arx run: | - cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - nix bundle --print-build-logs --out-link bundle-arx \ + nix bundle --print-build-logs --out-link bundle-arx \ --bundler github:nix-community/nix-bundle \ ".#villas-node-${{ matrix.system }}" mkdir -p artifacts @@ -124,10 +123,6 @@ jobs: pkg-nix-rpm: name: "pkg:nix:rpm [${{ matrix.system }}]" runs-on: ubuntu-latest - container: - image: docker.nix-community.org/nixpkgs/cachix-flakes - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} strategy: fail-fast: false matrix: @@ -138,13 +133,16 @@ jobs: fetch-depth: 0 submodules: recursive - - name: Configure Cachix - run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + - uses: cachix/install-nix-action@v31 + + - uses: cachix/cachix-action@v17 + with: + name: ${{ env.CACHIX_CACHE_NAME }} + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Bundle as RPM run: | - cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - nix bundle --print-build-logs --out-link bundle-rpm \ + nix bundle --print-build-logs --out-link bundle-rpm \ --bundler github:NixOS/bundlers#toRPM \ ".#villas-node-${{ matrix.system }}" mkdir -p artifacts @@ -159,10 +157,6 @@ jobs: pkg-nix-docker: name: "pkg:nix:docker [${{ matrix.system }}]" runs-on: ubuntu-latest - container: - image: docker.nix-community.org/nixpkgs/cachix-flakes - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} strategy: fail-fast: false matrix: @@ -173,14 +167,17 @@ jobs: fetch-depth: 0 submodules: recursive - - name: Configure Cachix - run: cachix use "${{ env.CACHIX_CACHE_NAME }}" + - uses: cachix/install-nix-action@v31 + + - uses: cachix/cachix-action@v17 + with: + name: ${{ env.CACHIX_CACHE_NAME }} + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - name: Bundle as Docker image run: | mkdir -p /var/tmp/ - cachix watch-exec "${{ env.CACHIX_CACHE_NAME }}" -- \ - nix bundle --print-build-logs --out-link bundle-docker \ + nix bundle --print-build-logs --out-link bundle-docker \ --bundler github:NixOS/bundlers#toDockerImage \ ".#villas-node-${{ matrix.system }}" From 7be7879e7c8325797f3a1ecae466a859e5afcc1b Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 18:10:35 +0200 Subject: [PATCH 31/50] ci: set SPDX copyright year to 2026 Signed-off-by: Leonardo Carreras --- .github/workflows/build.yml | 2 +- .github/workflows/checks.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/packaging.yml | 2 +- .github/workflows/prepare.yml | 2 +- .github/workflows/test.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3bf3535f..221c3f5c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 name: Build diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 32133b683..2223058b7 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 name: Checks diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd01836de..f952a80b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 name: CI diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8d090f3cc..6d4c01d4c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2014-2026 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 name: Deploy diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 02979fc91..4ae07d87b 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 name: Packaging diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index 588ede226..42cb37f3f 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 name: Prepare diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6076c82a..a0d11e530 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 name: Test From b8eb02901ac050af5161cc1a36a166d24b486a3e Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 18:13:49 +0200 Subject: [PATCH 32/50] ci: move nix build into its own workflow Signed-off-by: Leonardo Carreras --- .github/workflows/checks.yml | 26 ------------------------- .github/workflows/ci.yml | 4 ++++ .github/workflows/nix.yml | 37 ++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/nix.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 2223058b7..02b50dd24 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -6,36 +6,10 @@ name: Checks on: workflow_call: -env: - CACHIX_CACHE_NAME: ${{ vars.CACHIX_CACHE_NAME || 'villas' }} - permissions: contents: read jobs: - build-nix: - name: "build:nix [${{ matrix.system }}]" - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - system: [x86_64-linux, aarch64-linux] - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 0 - submodules: recursive - - - uses: cachix/install-nix-action@v31 - - - uses: cachix/cachix-action@v17 - with: - name: ${{ env.CACHIX_CACHE_NAME }} - authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} - - - name: Build - run: nix build --print-build-logs ".#villas-node-${{ matrix.system }}" - build-openapi: name: build:openapi runs-on: ubuntu-latest diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f952a80b0..80b38c882 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,10 @@ jobs: uses: ./.github/workflows/checks.yml secrets: inherit + nix: + uses: ./.github/workflows/nix.yml + secrets: inherit + prepare: needs: [setup] uses: ./.github/workflows/prepare.yml diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 000000000..50327ec9d --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: Nix + +on: + workflow_call: + +env: + CACHIX_CACHE_NAME: ${{ vars.CACHIX_CACHE_NAME || 'villas' }} + +permissions: + contents: read + +jobs: + build-nix: + name: "build:nix [${{ matrix.system }}]" + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + system: [x86_64-linux, aarch64-linux] + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + submodules: recursive + + - uses: cachix/install-nix-action@v31 + + - uses: cachix/cachix-action@v17 + with: + name: ${{ env.CACHIX_CACHE_NAME }} + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + + - name: Build + run: nix build --print-build-logs ".#villas-node-${{ matrix.system }}" From 79287d0bdba27ebdba019fc2c1f4759dfe8b8775 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 18:22:25 +0200 Subject: [PATCH 33/50] ci: pull prebuilt deps from villas cache in nix builds Signed-off-by: Leonardo Carreras --- .github/workflows/nix.yml | 1 + .github/workflows/packaging.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 50327ec9d..18f5d99b7 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -32,6 +32,7 @@ jobs: with: name: ${{ env.CACHIX_CACHE_NAME }} authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + extraPullNames: villas - name: Build run: nix build --print-build-logs ".#villas-node-${{ matrix.system }}" diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 4ae07d87b..d17d47c59 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -105,6 +105,7 @@ jobs: with: name: ${{ env.CACHIX_CACHE_NAME }} authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + extraPullNames: villas - name: Bundle as arx run: | @@ -139,6 +140,7 @@ jobs: with: name: ${{ env.CACHIX_CACHE_NAME }} authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + extraPullNames: villas - name: Bundle as RPM run: | @@ -173,6 +175,7 @@ jobs: with: name: ${{ env.CACHIX_CACHE_NAME }} authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + extraPullNames: villas - name: Bundle as Docker image run: | From b6937afab773c511b119a91aa41b622cd4124e7d Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 18:32:57 +0200 Subject: [PATCH 34/50] ci: trigger latest on version tags, manual otherwise Signed-off-by: Leonardo Carreras --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80b38c882..9c49c7aa4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,4 +70,5 @@ jobs: uses: ./.github/workflows/deploy.yml with: docker_image: ${{ needs.setup.outputs.docker_image }} + is_version_tag: ${{ startsWith(github.ref, 'refs/tags/v') }} secrets: inherit From eb3c14558125861ed232fe336d1102ee2a17a37e Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 18:32:58 +0200 Subject: [PATCH 35/50] ci: cache docker layers to speed up image builds Signed-off-by: Leonardo Carreras --- .github/workflows/packaging.yml | 4 ++++ .github/workflows/prepare.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index d17d47c59..e13c4ba76 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -49,6 +49,8 @@ jobs: push: true pull: true platforms: amd64 + cache-from: type=gha,scope=app-x86_64 + cache-to: type=gha,mode=max,scope=app-x86_64 build-args: | ARCH=x86_64 TRIPLET=x86_64-linux-gnu @@ -80,6 +82,8 @@ jobs: push: true pull: true platforms: linux/arm64 + cache-from: type=gha,scope=app-arm64 + cache-to: type=gha,mode=max,scope=app-arm64 build-args: | ARCH=arm64 TRIPLET=aarch64-linux-gnu diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index 42cb37f3f..0711e8ee3 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -92,6 +92,8 @@ jobs: file: ${{ matrix.docker_file }} target: ${{ matrix.target || 'dev' }} push: true + cache-from: type=gha,scope=dev-${{ matrix.image_name }} + cache-to: type=gha,mode=max,scope=dev-${{ matrix.image_name }} tags: | ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ steps.hash.outputs.tag }} ${{ env.DOCKER_IMAGE }}/dev-${{ matrix.image_name }}:${{ env.DOCKER_TAG }} From 96ea52056d79411f1abfb26c908f2edb59481091 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 18:36:18 +0200 Subject: [PATCH 36/50] ci: add scheduled cleanup of old PR and branch images Signed-off-by: Leonardo Carreras --- .github/workflows/cleanup.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/cleanup.yml diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml new file mode 100644 index 000000000..3084b3f54 --- /dev/null +++ b/.github/workflows/cleanup.yml @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: Cleanup + +on: + schedule: + - cron: "0 3 * * *" + workflow_dispatch: + +permissions: + packages: write + +jobs: + cleanup-packages: + name: cleanup:packages + runs-on: ubuntu-latest + steps: + # Deletes PR, branch, SHA and content-hash image versions older than + # 14 days. Version tags (v*), master and latest are kept forever. + # Starts in dry-run: review one run's log, then set dry-run to false. + - uses: dataaxiom/ghcr-cleanup-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + owner: ${{ github.repository_owner }} + packages: ^villas/node(/.*)?$ + expand-packages: true + use-regex: true + exclude-tags: ^(latest|master.*|v.*)$ + older-than: 14 days + delete-untagged: true + dry-run: true From 933635d5de672a7107c49068a5a03905a1bb4950 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 18:59:12 +0200 Subject: [PATCH 37/50] build(docker): prefer Azure Ubuntu mirror to avoid apt throttling Signed-off-by: Leonardo Carreras --- packaging/docker/Dockerfile.ubuntu | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packaging/docker/Dockerfile.ubuntu b/packaging/docker/Dockerfile.ubuntu index 5a4a0c506..817d8ee1f 100644 --- a/packaging/docker/Dockerfile.ubuntu +++ b/packaging/docker/Dockerfile.ubuntu @@ -15,6 +15,13 @@ ARG DISTRO ENV DEBIAN_FRONTEND=noninteractive +# Prefer Azure's Ubuntu mirror (fast on Azure-hosted CI runners) while keeping +# the default archive as a fallback. archive.ubuntu.com can throttle to a few +# kB/s from Azure, which stalls the package install for tens of minutes. +RUN sed -i -E \ + 's#https?://(archive|security)\.ubuntu\.com/ubuntu/?#http://azure.archive.ubuntu.com/ubuntu/ &#g' \ + /etc/apt/sources.list.d/ubuntu.sources 2>/dev/null || true + # Toolchain RUN apt-get update && \ apt-get install -y \ From fc1441304d51541de66ae6561338ff25cb3bc758 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 19:11:21 +0200 Subject: [PATCH 38/50] ci: match cmake parallelism to runner cores Signed-off-by: Leonardo Carreras --- .github/workflows/build.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 221c3f5c9..ed353326f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ on: type: string env: - CMAKE_BUILD_OPTS: --parallel 16 + CMAKE_BUILD_OPTS: --parallel $(nproc) CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release permissions: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a0d11e530..dc98fd5c8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ on: type: string env: - CMAKE_BUILD_OPTS: --parallel 16 + CMAKE_BUILD_OPTS: --parallel $(nproc) CMAKE_OPTS: -DCMAKE_INSTALL_PREFIX=${PREFIX} permissions: From 819e64c80315ba1a5f5afc099ea76188c34faf92 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 19:19:47 +0200 Subject: [PATCH 39/50] ci: include top-level packaging patches in dev image hash Signed-off-by: Leonardo Carreras --- .github/workflows/prepare.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index 0711e8ee3..d67713905 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -69,7 +69,7 @@ jobs: - name: Compute image content hash id: hash - run: echo "tag=${{ hashFiles(matrix.docker_file, 'packaging/deps.sh', 'packaging/patches/**', 'python/**') }}" >> "$GITHUB_OUTPUT" + run: echo "tag=${{ hashFiles(matrix.docker_file, 'packaging/deps.sh', 'packaging/patches/**', 'packaging/*.patch', 'python/**') }}" >> "$GITHUB_OUTPUT" - name: Check for an already-built image id: existing From 4e6d45c9378bad4b7dee4188e2a6c8812be29ab3 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 19:36:06 +0200 Subject: [PATCH 40/50] ci: reuse prepare dev layers in app image build cache Signed-off-by: Leonardo Carreras --- .github/workflows/packaging.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index e13c4ba76..4c1adc354 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -49,7 +49,9 @@ jobs: push: true pull: true platforms: amd64 - cache-from: type=gha,scope=app-x86_64 + cache-from: | + type=gha,scope=dev-fedora + type=gha,scope=app-x86_64 cache-to: type=gha,mode=max,scope=app-x86_64 build-args: | ARCH=x86_64 From 9aade0b6b0d5f2b00ba1b8fab02433d2852dcb8e Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 19:40:36 +0200 Subject: [PATCH 41/50] ci: cache fedora compilation with ccache Signed-off-by: Leonardo Carreras --- .github/workflows/build.yml | 14 +++++++++++++- .github/workflows/test.yml | 20 ++++++++++++++++++-- packaging/docker/Dockerfile.fedora | 2 +- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed353326f..b0e9e22d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,7 @@ on: env: CMAKE_BUILD_OPTS: --parallel $(nproc) CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release + CCACHE_DIR: ${{ github.workspace }}/.ccache permissions: contents: read @@ -31,7 +32,10 @@ jobs: include: - distro: fedora image_name: fedora - cmake_extra_opts: -DVILLAS_COMPILE_WARNING_AS_ERROR=ON + cmake_extra_opts: >- + -DVILLAS_COMPILE_WARNING_AS_ERROR=ON + -DCMAKE_C_COMPILER_LAUNCHER=ccache + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache - distro: fedora-minimal image_name: fedora-minimal cmake_extra_opts: >- @@ -66,6 +70,14 @@ jobs: fetch-depth: 0 submodules: recursive + - name: ccache + if: matrix.distro == 'fedora' + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/.ccache + key: ccache-fedora-${{ github.sha }} + restore-keys: ccache-fedora- + - name: Configure run: cmake -S . -B build ${{ matrix.cmake_extra_opts || env.CMAKE_EXTRA_OPTS }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dc98fd5c8..496cd6cf4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,6 +13,8 @@ on: env: CMAKE_BUILD_OPTS: --parallel $(nproc) CMAKE_OPTS: -DCMAKE_INSTALL_PREFIX=${PREFIX} + CCACHE: -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache + CCACHE_DIR: ${{ github.workspace }}/.ccache permissions: contents: read @@ -84,8 +86,15 @@ jobs: fetch-depth: 0 submodules: recursive + - name: ccache + uses: actions/cache/restore@v4 + with: + path: ${{ github.workspace }}/.ccache + key: ccache-fedora-${{ github.sha }} + restore-keys: ccache-fedora- + - name: Configure - run: cmake -S . -B build + run: cmake -S . -B build ${{ env.CCACHE }} - name: Build and run unit tests run: LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH cmake --build build ${{ env.CMAKE_BUILD_OPTS }} --target run-unit-tests run-unit-tests-common @@ -107,6 +116,13 @@ jobs: fetch-depth: 0 submodules: recursive + - name: ccache + uses: actions/cache/restore@v4 + with: + path: ${{ github.workspace }}/.ccache + key: ccache-fedora-${{ github.sha }} + restore-keys: ccache-fedora- + - name: Start mosquitto run: | echo "127.0.0.1 mosquitto" >> /etc/hosts @@ -118,7 +134,7 @@ jobs: - name: Configure run: | - cmake -S . -B build + cmake -S . -B build ${{ env.CCACHE }} cmake --build build --target install - name: Build and run integration tests diff --git a/packaging/docker/Dockerfile.fedora b/packaging/docker/Dockerfile.fedora index 2beee634f..f177bda64 100644 --- a/packaging/docker/Dockerfile.fedora +++ b/packaging/docker/Dockerfile.fedora @@ -15,7 +15,7 @@ ARG DISTRO # Toolchain RUN dnf -y install \ gcc-14 g++-14 \ - pkgconfig cmake make meson ninja \ + pkgconfig cmake make meson ninja ccache \ autoconf automake autogen libtool \ texinfo git awk git-svn curl tar patchutils \ flex bison \ From fb2952916147c2cf0e9cf439b7603464e738cef1 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 22:46:39 +0200 Subject: [PATCH 42/50] ci: sanitize ref tags in packaging/deploy and fix dev-vscode alias Signed-off-by: Leonardo Carreras --- .github/workflows/deploy.yml | 54 +++++++++++++++++++++++++-------- .github/workflows/packaging.yml | 18 +++++++++-- 2 files changed, 56 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6d4c01d4c..5fc8dc636 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -35,12 +35,16 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - name: Create and push multi-arch manifest run: | docker buildx imagetools create \ - -t "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}" \ - "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ - "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" + -t "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}" \ + "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-x86_64" \ + "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-arm64" deploy-docker-dev: name: deploy:docker-dev @@ -54,11 +58,15 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - name: Publish dev image for current ref run: | docker buildx imagetools create \ - -t "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" \ - "${{ env.DOCKER_IMAGE }}/dev-fedora:${{ github.ref_name }}" + -t "${{ env.DOCKER_IMAGE }}/dev:${{ steps.ref.outputs.tag }}" \ + "${{ env.DOCKER_IMAGE }}/dev-fedora:${{ steps.ref.outputs.tag }}" deploy-docker-dev-vscode: name: deploy:docker-dev-vscode @@ -72,11 +80,15 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - name: Publish dev-vscode image for current ref run: | docker buildx imagetools create \ - -t "${{ env.DOCKER_IMAGE }}/dev-vscode:${{ github.ref_name }}" \ - "${{ env.DOCKER_IMAGE }}/dev-vscode:${{ github.ref_name }}" + -t "${{ env.DOCKER_IMAGE }}/dev-vscode:${{ steps.ref.outputs.tag }}" \ + "${{ env.DOCKER_IMAGE }}/dev-vscode:${{ github.sha }}" latest-docker: name: latest:docker @@ -92,12 +104,16 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - name: Tag and push app image as latest run: | docker buildx imagetools create \ -t "${{ env.DOCKER_IMAGE }}:latest" \ - "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ - "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" + "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-x86_64" \ + "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-arm64" latest-docker-dev: name: latest:docker-dev @@ -113,11 +129,15 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - name: Tag and push dev image as latest run: | docker buildx imagetools create \ -t "${{ env.DOCKER_IMAGE }}/dev:latest" \ - "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" + "${{ env.DOCKER_IMAGE }}/dev:${{ steps.ref.outputs.tag }}" latest-docker-manual: name: latest:docker (manual) @@ -134,12 +154,16 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - name: Tag and push app image as latest (manual) run: | docker buildx imagetools create \ -t "${{ env.DOCKER_IMAGE }}:latest" \ - "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64" \ - "${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64" + "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-x86_64" \ + "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-arm64" latest-docker-dev-manual: name: latest:docker-dev (manual) @@ -156,8 +180,12 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - name: Tag and push dev image as latest (manual) run: | docker buildx imagetools create \ -t "${{ env.DOCKER_IMAGE }}/dev:latest" \ - "${{ env.DOCKER_IMAGE }}/dev:${{ github.ref_name }}" + "${{ env.DOCKER_IMAGE }}/dev:${{ steps.ref.outputs.tag }}" diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 4c1adc354..7a07dc92a 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -41,6 +41,10 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - uses: docker/build-push-action@v7 with: context: . @@ -57,7 +61,7 @@ jobs: ARCH=x86_64 TRIPLET=x86_64-linux-gnu CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} - tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-x86_64 + tags: ${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-x86_64 pkg-docker-arm64: name: "pkg:docker [arm64]" @@ -76,6 +80,10 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - uses: docker/build-push-action@v7 with: context: . @@ -90,7 +98,7 @@ jobs: ARCH=arm64 TRIPLET=aarch64-linux-gnu CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} - tags: ${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-arm64 + tags: ${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-arm64 pkg-nix-arx: name: "pkg:nix:arx [${{ matrix.system }}]" @@ -190,6 +198,10 @@ jobs: --bundler github:NixOS/bundlers#toDockerImage \ ".#villas-node-${{ matrix.system }}" + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + - name: Push to registry run: | nix run nixpkgs#skopeo -- login \ @@ -200,4 +212,4 @@ jobs: --tmpdir="${{ runner.temp }}" \ --insecure-policy \ copy "docker-archive:./bundle-docker" \ - "docker://${{ env.DOCKER_IMAGE }}:${{ github.ref_name }}-nix-${{ matrix.system }}" + "docker://${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-nix-${{ matrix.system }}" From 6a0a6ac302a2257e24a0e0604bbdf704657c8384 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 22:53:02 +0200 Subject: [PATCH 43/50] ci: reuse build:source artifact in test jobs instead of recompiling Signed-off-by: Leonardo Carreras --- .github/workflows/test.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 496cd6cf4..18bd18e33 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,6 +19,7 @@ env: permissions: contents: read packages: read + actions: read jobs: test-python: @@ -86,6 +87,12 @@ jobs: fetch-depth: 0 submodules: recursive + - name: Reuse compiled tree from build:source [fedora] + uses: actions/download-artifact@v7 + with: + name: build-fedora + path: build + - name: ccache uses: actions/cache/restore@v4 with: @@ -116,6 +123,12 @@ jobs: fetch-depth: 0 submodules: recursive + - name: Reuse compiled tree from build:source [fedora] + uses: actions/download-artifact@v7 + with: + name: build-fedora + path: build + - name: ccache uses: actions/cache/restore@v4 with: From 9889c19f003ab6c0a03cc2382b5bc59456108bd5 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 23:14:13 +0200 Subject: [PATCH 44/50] ci: split packaging into docker and nix; deploy needs only docker Signed-off-by: Leonardo Carreras --- .github/workflows/ci.yml | 14 ++- .github/workflows/packaging-docker.yml | 100 ++++++++++++++++++ .../{packaging.yml => packaging-nix.yml} | 82 +------------- 3 files changed, 112 insertions(+), 84 deletions(-) create mode 100644 .github/workflows/packaging-docker.yml rename .github/workflows/{packaging.yml => packaging-nix.yml} (62%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c49c7aa4..250532b6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,17 +56,25 @@ jobs: docker_image: ${{ needs.setup.outputs.docker_image }} secrets: inherit - packaging: + packaging-docker: if: github.event_name != 'pull_request' needs: [setup, test] - uses: ./.github/workflows/packaging.yml + uses: ./.github/workflows/packaging-docker.yml + with: + docker_image: ${{ needs.setup.outputs.docker_image }} + secrets: inherit + + packaging-nix: + if: github.event_name != 'pull_request' + needs: [setup, test] + uses: ./.github/workflows/packaging-nix.yml with: docker_image: ${{ needs.setup.outputs.docker_image }} secrets: inherit deploy: if: github.event_name != 'pull_request' - needs: [setup, packaging] + needs: [setup, packaging-docker] uses: ./.github/workflows/deploy.yml with: docker_image: ${{ needs.setup.outputs.docker_image }} diff --git a/.github/workflows/packaging-docker.yml b/.github/workflows/packaging-docker.yml new file mode 100644 index 000000000..2be218c98 --- /dev/null +++ b/.github/workflows/packaging-docker.yml @@ -0,0 +1,100 @@ +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: Packaging (Docker) + +on: + workflow_call: + inputs: + docker_image: + required: true + type: string + +env: + REGISTRY: ghcr.io + DOCKER_IMAGE: ${{ inputs.docker_image }} + CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release + DOCKER_FILE: packaging/docker/Dockerfile.fedora + +permissions: + contents: read + packages: write + +jobs: + pkg-docker-x86_64: + name: "pkg:docker [x86_64]" + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + submodules: recursive + + - uses: docker/setup-buildx-action@v4 + + - uses: docker/login-action@v4 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + + - uses: docker/build-push-action@v7 + with: + context: . + file: ${{ env.DOCKER_FILE }} + target: app + push: true + pull: true + platforms: amd64 + cache-from: | + type=gha,scope=dev-fedora + type=gha,scope=app-x86_64 + cache-to: type=gha,mode=max,scope=app-x86_64 + build-args: | + ARCH=x86_64 + TRIPLET=x86_64-linux-gnu + CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} + tags: ${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-x86_64 + + pkg-docker-arm64: + name: "pkg:docker [arm64]" + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + submodules: recursive + + - uses: docker/setup-buildx-action@v4 + + - uses: docker/login-action@v4 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + + - uses: docker/build-push-action@v7 + with: + context: . + file: packaging/docker/Dockerfile.debian + target: app + push: true + pull: true + platforms: linux/arm64 + cache-from: type=gha,scope=app-arm64 + cache-to: type=gha,mode=max,scope=app-arm64 + build-args: | + ARCH=arm64 + TRIPLET=aarch64-linux-gnu + CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} + tags: ${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-arm64 diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging-nix.yml similarity index 62% rename from .github/workflows/packaging.yml rename to .github/workflows/packaging-nix.yml index 7a07dc92a..dceafcc16 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging-nix.yml @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 -name: Packaging +name: Packaging (Nix) on: workflow_call: @@ -13,93 +13,13 @@ on: env: REGISTRY: ghcr.io DOCKER_IMAGE: ${{ inputs.docker_image }} - CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release CACHIX_CACHE_NAME: ${{ vars.CACHIX_CACHE_NAME || 'villas' }} - DOCKER_FILE: packaging/docker/Dockerfile.fedora permissions: contents: read packages: write jobs: - pkg-docker-x86_64: - name: "pkg:docker [x86_64]" - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 0 - submodules: recursive - - - uses: docker/setup-buildx-action@v4 - - - uses: docker/login-action@v4 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Compute safe ref tag - id: ref - run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" - - - uses: docker/build-push-action@v7 - with: - context: . - file: ${{ env.DOCKER_FILE }} - target: app - push: true - pull: true - platforms: amd64 - cache-from: | - type=gha,scope=dev-fedora - type=gha,scope=app-x86_64 - cache-to: type=gha,mode=max,scope=app-x86_64 - build-args: | - ARCH=x86_64 - TRIPLET=x86_64-linux-gnu - CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} - tags: ${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-x86_64 - - pkg-docker-arm64: - name: "pkg:docker [arm64]" - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 0 - submodules: recursive - - - uses: docker/setup-buildx-action@v4 - - - uses: docker/login-action@v4 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Compute safe ref tag - id: ref - run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" - - - uses: docker/build-push-action@v7 - with: - context: . - file: packaging/docker/Dockerfile.debian - target: app - push: true - pull: true - platforms: linux/arm64 - cache-from: type=gha,scope=app-arm64 - cache-to: type=gha,mode=max,scope=app-arm64 - build-args: | - ARCH=arm64 - TRIPLET=aarch64-linux-gnu - CMAKE_OPTS=${{ env.CMAKE_EXTRA_OPTS }} - tags: ${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-arm64 - pkg-nix-arx: name: "pkg:nix:arx [${{ matrix.system }}]" runs-on: ubuntu-latest From 4c047c446358f23a0316397f8065cca3da7001ae Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 23:19:21 +0200 Subject: [PATCH 45/50] ci: fix skopeo registries.conf v1/v2 clash in pkg:nix:docker Signed-off-by: Leonardo Carreras --- .github/workflows/packaging-nix.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/packaging-nix.yml b/.github/workflows/packaging-nix.yml index dceafcc16..99ba6fa95 100644 --- a/.github/workflows/packaging-nix.yml +++ b/.github/workflows/packaging-nix.yml @@ -123,7 +123,12 @@ jobs: run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" - name: Push to registry + env: + # The GitHub runner ships a v1 /etc/containers/registries.conf, which + # the nixpkgs skopeo (v2-only) rejects. Point it at a minimal v2 file. + CONTAINERS_REGISTRIES_CONF: ${{ runner.temp }}/registries.conf run: | + echo 'unqualified-search-registries = []' > "$CONTAINERS_REGISTRIES_CONF" nix run nixpkgs#skopeo -- login \ --username "${{ github.actor }}" \ --password "${{ secrets.GITHUB_TOKEN }}" \ From a398d9ed8c58c540c820310997a2f2029d61ce90 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 23:44:06 +0200 Subject: [PATCH 46/50] ci: bump actions/cache to v6 to drop Node 20 runtime Signed-off-by: Leonardo Carreras --- .github/workflows/build.yml | 2 +- .github/workflows/test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b0e9e22d3..a8fe081c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,7 +72,7 @@ jobs: - name: ccache if: matrix.distro == 'fedora' - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: ${{ github.workspace }}/.ccache key: ccache-fedora-${{ github.sha }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 18bd18e33..d3b7c956f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -94,7 +94,7 @@ jobs: path: build - name: ccache - uses: actions/cache/restore@v4 + uses: actions/cache/restore@v6 with: path: ${{ github.workspace }}/.ccache key: ccache-fedora-${{ github.sha }} @@ -130,7 +130,7 @@ jobs: path: build - name: ccache - uses: actions/cache/restore@v4 + uses: actions/cache/restore@v6 with: path: ${{ github.workspace }}/.ccache key: ccache-fedora-${{ github.sha }} From 6c1db1723748ce7b2438baaa6e061c8891abf953 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 23:44:06 +0200 Subject: [PATCH 47/50] ci: cap nix artifact retention at 90 days (repo max) Signed-off-by: Leonardo Carreras --- .github/workflows/packaging-nix.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/packaging-nix.yml b/.github/workflows/packaging-nix.yml index 99ba6fa95..ecc240c3e 100644 --- a/.github/workflows/packaging-nix.yml +++ b/.github/workflows/packaging-nix.yml @@ -53,7 +53,7 @@ jobs: with: name: villas-arx-${{ matrix.system }} path: artifacts/ - retention-days: 365 + retention-days: 90 pkg-nix-rpm: name: "pkg:nix:rpm [${{ matrix.system }}]" @@ -88,7 +88,7 @@ jobs: with: name: villas-rpm-${{ matrix.system }} path: artifacts/ - retention-days: 365 + retention-days: 90 pkg-nix-docker: name: "pkg:nix:docker [${{ matrix.system }}]" From ae156f412cf779f3dfe4da60dd35d3b180144410 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 23:47:44 +0200 Subject: [PATCH 48/50] build(docker): declare app-stage ARGs to fix UndefinedVar lint Signed-off-by: Leonardo Carreras --- packaging/docker/Dockerfile.fedora | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packaging/docker/Dockerfile.fedora b/packaging/docker/Dockerfile.fedora index f177bda64..c78a8fca0 100644 --- a/packaging/docker/Dockerfile.fedora +++ b/packaging/docker/Dockerfile.fedora @@ -6,7 +6,8 @@ ARG DISTRO=fedora ARG FEDORA_VERSION=42 -ARG REF=unknown +ARG ARCH=x86_64 +ARG REF=villasnode FROM ${DISTRO}:${FEDORA_VERSION} AS dev @@ -111,6 +112,10 @@ RUN groupadd --gid $USER_GID $USERNAME \ FROM dev AS app ARG CMAKE_OPTS +ARG DISTRO +ARG FEDORA_VERSION +ARG ARCH +ARG REF COPY . /villas/ From a820a603dc88fe4376cd9507b6d75dcfe9bf3d76 Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Wed, 22 Jul 2026 23:52:56 +0200 Subject: [PATCH 49/50] ci: publish multi-arch nix manifest and attach arx/rpm to releases Signed-off-by: Leonardo Carreras --- .github/workflows/ci.yml | 9 +++ .github/workflows/deploy-nix.yml | 121 ++++++++++++++++++++++++++++ .github/workflows/packaging-nix.yml | 2 - 3 files changed, 130 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy-nix.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 250532b6a..928602fcf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,3 +80,12 @@ jobs: docker_image: ${{ needs.setup.outputs.docker_image }} is_version_tag: ${{ startsWith(github.ref, 'refs/tags/v') }} secrets: inherit + + deploy-nix: + if: github.event_name != 'pull_request' + needs: [setup, packaging-nix] + uses: ./.github/workflows/deploy-nix.yml + with: + docker_image: ${{ needs.setup.outputs.docker_image }} + is_version_tag: ${{ startsWith(github.ref, 'refs/tags/v') }} + secrets: inherit diff --git a/.github/workflows/deploy-nix.yml b/.github/workflows/deploy-nix.yml new file mode 100644 index 000000000..3e0c26037 --- /dev/null +++ b/.github/workflows/deploy-nix.yml @@ -0,0 +1,121 @@ +# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University +# SPDX-License-Identifier: Apache-2.0 + +name: Deploy (Nix) + +on: + workflow_call: + inputs: + docker_image: + required: true + type: string + is_version_tag: + required: false + type: boolean + default: false + +env: + REGISTRY: ghcr.io + DOCKER_IMAGE: ${{ inputs.docker_image }} + +permissions: + contents: read + packages: write + +jobs: + deploy-docker-nix: + name: deploy:docker-nix + runs-on: ubuntu-latest + steps: + - uses: docker/setup-buildx-action@v4 + + - uses: docker/login-action@v4 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + + - name: Create and push multi-arch nix manifest + run: | + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-nix" \ + "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-nix-x86_64-linux" \ + "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-nix-aarch64-linux" + + latest-docker-nix: + name: latest:docker-nix + if: ${{ inputs.is_version_tag }} + needs: [deploy-docker-nix] + runs-on: ubuntu-latest + steps: + - uses: docker/setup-buildx-action@v4 + + - uses: docker/login-action@v4 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + + - name: Tag nix manifest as latest-nix + run: | + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}:latest-nix" \ + "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-nix" + + latest-docker-nix-manual: + name: latest:docker-nix (manual) + if: ${{ !inputs.is_version_tag }} + needs: [deploy-docker-nix] + runs-on: ubuntu-latest + environment: latest-docker-nix-manual + steps: + - uses: docker/setup-buildx-action@v4 + + - uses: docker/login-action@v4 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Compute safe ref tag + id: ref + run: echo "tag=${GITHUB_REF_NAME//\//-}" >> "$GITHUB_OUTPUT" + + - name: Tag nix manifest as latest-nix (manual) + run: | + docker buildx imagetools create \ + -t "${{ env.DOCKER_IMAGE }}:latest-nix" \ + "${{ env.DOCKER_IMAGE }}:${{ steps.ref.outputs.tag }}-nix" + + release-nix: + name: release:nix + if: ${{ inputs.is_version_tag }} + runs-on: ubuntu-latest + permissions: + contents: write + actions: read + steps: + - uses: actions/download-artifact@v7 + with: + pattern: villas-* + path: dist + merge-multiple: true + + - name: Publish arx and rpm bundles to the release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create "${GITHUB_REF_NAME}" dist/* \ + --repo "${GITHUB_REPOSITORY}" \ + --title "${GITHUB_REF_NAME}" \ + --generate-notes \ + || gh release upload "${GITHUB_REF_NAME}" dist/* \ + --repo "${GITHUB_REPOSITORY}" --clobber diff --git a/.github/workflows/packaging-nix.yml b/.github/workflows/packaging-nix.yml index ecc240c3e..c4b9a4171 100644 --- a/.github/workflows/packaging-nix.yml +++ b/.github/workflows/packaging-nix.yml @@ -124,8 +124,6 @@ jobs: - name: Push to registry env: - # The GitHub runner ships a v1 /etc/containers/registries.conf, which - # the nixpkgs skopeo (v2-only) rejects. Point it at a minimal v2 file. CONTAINERS_REGISTRIES_CONF: ${{ runner.temp }}/registries.conf run: | echo 'unqualified-search-registries = []' > "$CONTAINERS_REGISTRIES_CONF" From 6ea39f71d7e588536f810752a5f720533d15e31e Mon Sep 17 00:00:00 2001 From: Leonardo Carreras Date: Thu, 23 Jul 2026 00:58:19 +0200 Subject: [PATCH 50/50] ci: trim obvious comments, keep non-obvious rationale Signed-off-by: Leonardo Carreras --- .github/workflows/prepare.yml | 1 - packaging/docker/Dockerfile.ubuntu | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/prepare.yml b/.github/workflows/prepare.yml index d67713905..4d195d53d 100644 --- a/.github/workflows/prepare.yml +++ b/.github/workflows/prepare.yml @@ -74,7 +74,6 @@ jobs: - name: Check for an already-built image id: existing run: | - # Always rebuild on master; otherwise reuse an identical image if it exists. if [ "${{ github.ref_name }}" = "master" ]; then echo "exists=false" >> "$GITHUB_OUTPUT" elif docker buildx imagetools inspect \ diff --git a/packaging/docker/Dockerfile.ubuntu b/packaging/docker/Dockerfile.ubuntu index 817d8ee1f..76c21e2a7 100644 --- a/packaging/docker/Dockerfile.ubuntu +++ b/packaging/docker/Dockerfile.ubuntu @@ -15,9 +15,7 @@ ARG DISTRO ENV DEBIAN_FRONTEND=noninteractive -# Prefer Azure's Ubuntu mirror (fast on Azure-hosted CI runners) while keeping -# the default archive as a fallback. archive.ubuntu.com can throttle to a few -# kB/s from Azure, which stalls the package install for tens of minutes. +# Prefer the Azure mirror (archive.ubuntu.com throttles from CI); default kept as fallback RUN sed -i -E \ 's#https?://(archive|security)\.ubuntu\.com/ubuntu/?#http://azure.archive.ubuntu.com/ubuntu/ &#g' \ /etc/apt/sources.list.d/ubuntu.sources 2>/dev/null || true