Skip to content

Commit

Permalink
upgrade to 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
hofbi committed Aug 27, 2024
1 parent d320fc9 commit f2d8e58
Show file tree
Hide file tree
Showing 24 changed files with 394 additions and 208 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ llvm*,
misc*,
modernize*,
readability*,
-misc-include-cleaner,
-modernize-use-trailing-return-type,
-readability-magic-numbers,
-llvmlibc-implementation-in-namespace,
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Software Lab",
"image": "makeappdev/cpp-dev",
"image": "makeappdev/cpp-dev:24.04",
"extensions": [
"ms-vscode.cpptools-extension-pack",
"eamodio.gitlens",
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:

cpp:
runs-on: ubuntu-latest
container: makeappdev/cpp-dev
container: makeappdev/cpp-dev:24.04
strategy:
matrix:
include:
- compiler: gcc
- compiler: clang
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build ${{ matrix.compiler }}
run: |
use_${{ matrix.compiler }}.sh
Expand All @@ -28,29 +28,29 @@ jobs:
make test
make coverage
cd ..
- uses: actions/upload-artifact@v3
if: ${{ matrix.compiler }} == 'gcc'
- uses: actions/upload-artifact@v4
if: ${{ matrix.compiler }} == 'clang'
with:
path: build/ccov/all-merged
name: artifacts-cpp

python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
curl -LsSf https://astral.sh/uv/install.sh | sh
uv pip install -r requirements.txt
- name: Tests
run: make test
- name: Coverage
run: make coverage_reports
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: tools/htmlcov
name: artifacts-python
Expand All @@ -61,27 +61,27 @@ jobs:
steps:
- name: Install rsync
run: apk add rsync
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
run: |
cd docs
make html
make pdf
cd ..
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: docs/output
name: artifacts-docs

slides:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
run: |
mkdir -p build && chmod -R 0777 build
make slides
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: slides/build
name: artifacts-slides
Expand All @@ -94,7 +94,7 @@ jobs:
- slides
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: Prepare Deploy
Expand Down
55 changes: 28 additions & 27 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
image: makeappdev/cpp-dev
image: makeappdev/cpp-dev:24.04

stages:
- build
- test
- deploy

.no_schedule: &no_schedule
.no_schedule:
except:
- schedules

Expand All @@ -14,20 +14,19 @@ stages:
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pip"
PRE_COMMIT_HOME: "${CI_PROJECT_DIR}/.cache/pre-commit"
before_script:
- python -V # Debug info
- python -m pip install --upgrade pip
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install --upgrade -r requirements.txt
- python -V
- pipx install uv
- uv venv
- source .venv/bin/activate
- uv pip install --upgrade -r requirements.txt
cache:
paths:
- .cache/pip
- .cache/pre-commit
- venv/
- .venv/

.build_template: &build_definition
<<: *no_schedule
.cpp_build:
extends: .no_schedule
stage: build
script:
- mkdir -p build
Expand All @@ -38,26 +37,27 @@ stages:
- make coverage

pre-commit_checks:
<<: *no_schedule
<<: *python_setup
extends:
- .no_schedule
- .python_setup
stage: build
script:
- pre-commit run --from-ref origin/master --to-ref HEAD

cpp_build_test_gcc:
<<: *build_definition
artifacts:
expire_in: 1 week
paths:
- build/ccov/all-merged/
extends: .cpp_build

cpp_build_test_clang:
<<: *build_definition
extends: .cpp_build
before_script:
- use_clang.sh
artifacts:
expire_in: 1 week
paths:
- build/ccov/all-merged/

slides:
<<: *no_schedule
extends: .no_schedule
variables:
DOCKER_TLS_CERTDIR: ""
stage: build
Expand All @@ -67,7 +67,7 @@ slides:
before_script:
- apk add --no-cache --update docker make curl && rm -rf /var/cache/apk/*
- mkdir -p ~/.docker/cli-plugins/
- curl -SL https://github.com/docker/compose/releases/download/v2.1.1/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
- curl -SL https://github.com/docker/compose/releases/download/v2.29.2/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
- chmod +x ~/.docker/cli-plugins/docker-compose
- docker compose --version
script:
Expand All @@ -79,7 +79,7 @@ slides:
- slides/build

docs:
<<: *no_schedule
extends: .no_schedule
stage: build
image: asciidoctor/docker-asciidoctor:latest
script:
Expand All @@ -92,8 +92,9 @@ docs:
- docs/output

python_tests:
<<: *no_schedule
<<: *python_setup
extends:
- .no_schedule
- .python_setup
stage: build
script:
- make test
Expand All @@ -109,10 +110,10 @@ python_tests:
path: tools/coverage.xml

pages:
<<: *no_schedule
extends: .no_schedule
stage: deploy
dependencies:
- cpp_build_test_gcc
- cpp_build_test_clang
- python_tests
- slides
- docs
Expand All @@ -139,7 +140,7 @@ pages:
- master

student_code_evaluation:
<<: *python_setup
<<: *python_setup # Use anchor over extends to avoid overriding the variables
only:
- schedules
variables:
Expand Down
58 changes: 39 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,6 @@ repos:
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
- repo: local
hooks:
- id: check-snake-case
name: check snake case
description: Check that all files are snake_case
entry: file names and paths must be snake_case
language: fail
files: "-|[A-Z]"
types_or:
- c++
- python
- shell
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand All @@ -33,17 +21,35 @@ repos:
- id: check-symlinks
- id: check-toml
- id: check-yaml
exclude: (?x)( .gitlab-ci.yml | .clang-format )
exclude: |
(?x)^(
.gitlab-ci.yml|
.clang-format
)
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: name-tests-test
args:
- --pytest-test-first
exclude: (?x)( tools/tests/code_evaluation/jobs/modules/ | tools/tests/helper.py )
exclude: |
(?x)^(
tools/tests/code_evaluation/jobs/modules/|
tools/tests/helper.py
)
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/luminartech/dev-tools
rev: 0.1.0
hooks:
- id: check-snake-case
- id: check-cpp-and-cu-unit-test-naming-pattern
- id: check-no-dashes
exclude: ^slides/
- id: check-number-of-lines-count
- id: check-shellscript-set-options
- id: check-non-existing-and-duplicate-excludes
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
Expand All @@ -65,13 +71,23 @@ repos:
rev: v0.13.0
hooks:
- id: yamlfmt
exclude: (?x)( .clang-format | .clang-tidy )
exclude: |
(?x)^(
.gitlab-ci.yml|
.clang-tidy|
.clang-format
)
- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: [--strict]
exclude: (?x)( .clang-format | .clang-tidy | docs/theme/tum.yml )
exclude: |
(?x)^(
.clang-format|
.clang-tidy|
docs/theme/tum.yml
)
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
Expand All @@ -98,7 +114,7 @@ repos:
additional_dependencies: [cmakelang]
exclude: cmake/.*
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.6
rev: v0.6.2
hooks:
- id: ruff
- id: ruff-format
Expand All @@ -124,15 +140,19 @@ repos:
hooks:
- id: pyupgrade
args: [--py310-plus, --keep-runtime-typing]
- repo: https://github.com/MarcoGorelli/auto-walrus
rev: 0.3.4
hooks:
- id: auto-walrus
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.1
rev: 0.29.2
hooks:
- id: check-github-workflows
- repo: https://github.com/crate-ci/typos
rev: v1.23.6
rev: v1.23.7
hooks:
- id: typos
1 change: 1 addition & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ rules:
truthy: disable

ignore: |
.venv/
venv/
workspace/
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ include(FetchContent)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CODE_COVERAGE ON)
include(CodeCoverage)
add_code_coverage_all_targets(EXCLUDE /usr/* /Library/*
${PROJECT_BINARY_DIR}/_deps/*)
add_code_coverage_all_targets(EXCLUDE /usr/* ${PROJECT_BINARY_DIR}/_deps/*)
add_custom_target(
coverage
DEPENDS ccov-all
Expand Down
Loading

0 comments on commit f2d8e58

Please sign in to comment.