Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://github.com/microsoft/vscode-dev-containers/tree/v0.195.0/containers/cpp
{
"name": "VILLASnode",
"image": "registry.git.rwth-aachen.de/acs/public/villas/node/dev-vscode",
"image": "ghcr.io/villasframework/villas/node/dev-vscode:master",
// Uncomment to build the devcontainer locally
// "build": {
// "dockerfile": "../packaging/docker/Dockerfile.fedora",
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0

name: Build

on:
workflow_call:
inputs:
docker_image:
required: true
type: string

env:
CMAKE_BUILD_OPTS: --parallel $(nproc)
CMAKE_EXTRA_OPTS: -DCMAKE_BUILD_TYPE=Release
CCACHE_DIR: ${{ github.workspace }}/.ccache

permissions:
contents: read
packages: write

jobs:
build-source:
name: "Build Source [${{ matrix.distro }}]"
runs-on: ubuntu-latest
container:
image: ${{ inputs.docker_image }}/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
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- 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:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
submodules: recursive

- name: Setup ccache
if: matrix.distro == 'fedora'
uses: actions/cache@v6
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 }}

- name: Build
run: cmake --build build ${{ env.CMAKE_BUILD_OPTS }}

- name: Upload Build Artifacts
uses: actions/upload-artifact@v7
with:
name: build-${{ matrix.distro }}
path: build/
retention-days: 7
71 changes: 71 additions & 0 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0

name: Checks

on:
workflow_call:

permissions:
contents: read

jobs:
build-openapi:
name: Build OpenAPI Documentation
runs-on: ubuntu-latest
container:
image: node:24-alpine
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Lint OpenAPI Specification
run: npx -y @redocly/cli lint --config doc/redocly.yaml doc/openapi/openapi.yaml

- name: Build OpenAPI Documentation
run: npx -y @redocly/cli build-docs --config doc/redocly.yaml doc/openapi/openapi.yaml --output openapi.html

- name: Upload OpenAPI HTML Documentation
uses: actions/upload-artifact@v7
with:
name: openapi
path: openapi.html

pre-commit:
name: Run 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

- name: Checkout
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: Check REUSE Compliance
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7

- name: REUSE Compliance Check
uses: fsfe/reuse-action@v6
108 changes: 108 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0

name: CI

on:
push:
branches: [master]
tags: ["v*"]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
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"

checks:
uses: ./.github/workflows/checks.yaml
secrets: inherit

paper:
uses: ./.github/workflows/paper.yaml
secrets: inherit

nix:
uses: ./.github/workflows/nix.yaml
secrets: inherit

prepare:
needs: [setup]
uses: ./.github/workflows/prepare.yaml
with:
docker_image: ${{ needs.setup.outputs.docker_image }}
secrets: inherit

build:
needs: [setup, prepare]
uses: ./.github/workflows/build.yaml
with:
docker_image: ${{ needs.setup.outputs.docker_image }}
secrets: inherit

test:
needs: [setup, build]
uses: ./.github/workflows/test.yaml
with:
docker_image: ${{ needs.setup.outputs.docker_image }}
secrets: inherit

packaging-docker:
needs: [setup, test, prepare]
uses: ./.github/workflows/packaging-docker.yaml
with:
docker_image: ${{ needs.setup.outputs.docker_image }}
secrets: inherit

packaging-nix:
needs: [setup, nix]
uses: ./.github/workflows/packaging-nix.yaml
with:
docker_image: ${{ needs.setup.outputs.docker_image }}
secrets: inherit

deploy:
needs: [setup, packaging-docker]
uses: ./.github/workflows/deploy.yaml
with:
docker_image: ${{ needs.setup.outputs.docker_image }}
is_version_tag: ${{ startsWith(github.ref, 'refs/tags/v') }}
secrets: inherit

deploy-nix:
needs: [setup, packaging-nix]
uses: ./.github/workflows/deploy-nix.yaml
with:
docker_image: ${{ needs.setup.outputs.docker_image }}
is_version_tag: ${{ startsWith(github.ref, 'refs/tags/v') }}
secrets: inherit

tag-minor-release:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
needs:
- setup
- checks
- paper
- nix
- prepare
- build
- test
- packaging-docker
- packaging-nix
- deploy
- deploy-nix
uses: ./.github/workflows/tag-minor-release.yaml
secrets: inherit
33 changes: 33 additions & 0 deletions .github/workflows/cleanup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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: 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.
- name: Cleanup GHCR Packages
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
Loading