Skip to content

Commit b548695

Browse files
authored
Merge branch 'master' into dockerize-ubuntu
2 parents 2161ff6 + d6e198c commit b548695

17 files changed

Lines changed: 370 additions & 117 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "Parallel Programming Course",
3+
"image": "ghcr.io/learning-process/ppc-ubuntu:latest",
4+
"customizations": {
5+
"vscode": {
6+
"extensions": [
7+
"ms-vscode.cpptools-extension-pack",
8+
"ms-vscode.cmake-tools",
9+
"ms-python.python"
10+
],
11+
"settings": {
12+
"cmake.configureOnOpen": true,
13+
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools"
14+
}
15+
}
16+
},
17+
"postCreateCommand": "python3 -m pip install -r requirements.txt"
18+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: 'Update Pre-commit Hooks'
2+
description: 'Updates pre-commit hook versions and creates a PR if changes are detected'
3+
inputs:
4+
token:
5+
description: 'GitHub token for creating PRs'
6+
required: true
7+
python-version:
8+
description: 'Python version to use'
9+
required: false
10+
default: '3.13'
11+
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ inputs.python-version }}
19+
- name: Install pre-commit
20+
shell: bash
21+
run: pip install pre-commit
22+
- name: Update pre-commit hooks
23+
shell: bash
24+
run: |
25+
pre-commit autoupdate > /tmp/autoupdate.log 2>&1
26+
cat /tmp/autoupdate.log
27+
- name: Check for changes
28+
id: changes
29+
shell: bash
30+
run: |
31+
if git diff --quiet .pre-commit-config.yaml; then
32+
echo "changed=false" >> $GITHUB_OUTPUT
33+
else
34+
echo "changed=true" >> $GITHUB_OUTPUT
35+
fi
36+
- name: Create Pull Request
37+
if: steps.changes.outputs.changed == 'true'
38+
uses: peter-evans/create-pull-request@v7
39+
with:
40+
token: ${{ inputs.token }}
41+
commit-message: "[pre-commit] Update hooks versions"
42+
title: "[pre-commit] Update hooks versions"
43+
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
44+
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
45+
body: |
46+
🤖 This PR was created automatically by the update-pre-commit workflow.
47+
branch: update-pre-commit-hooks
48+
base: master
49+
delete-branch: true
50+
labels: |
51+
dependencies

.github/workflows/cmake-lint.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/docker.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
- master
55
paths:
66
- 'docker/**'
7+
- '.github/workflows/docker.yml'
78
pull_request_target:
89
paths:
910
- 'docker/**'
11+
- '.github/workflows/docker.yml'
1012
workflow_dispatch:
1113

1214
permissions:
@@ -35,7 +37,7 @@ jobs:
3537
with:
3638
registry: ghcr.io
3739
username: ${{ github.actor }}
38-
password: ${{ secrets.DOCKER_TOKEN }}
40+
password: ${{ secrets.GITHUB_TOKEN }}
3941

4042
- name: Build and push multi-arch image
4143
uses: docker/build-push-action@v6

.github/workflows/main.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,17 @@ concurrency:
1818
jobs:
1919
cpp-lint:
2020
uses: ./.github/workflows/cpp-lint.yml
21-
shell-lint:
22-
uses: ./.github/workflows/shell-lint.yml
2321
ubuntu:
2422
needs:
2523
- cpp-lint
26-
- shell-lint
2724
uses: ./.github/workflows/ubuntu.yml
2825
mac:
2926
needs:
3027
- cpp-lint
31-
- shell-lint
3228
uses: ./.github/workflows/mac.yml
3329
windows:
3430
needs:
3531
- cpp-lint
36-
- shell-lint
3732
uses: ./.github/workflows/windows.yml
3833
perf:
3934
needs:

.github/workflows/shell-lint.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Update pre-commit hooks
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
actions: write
12+
checks: write
13+
repository-projects: write
14+
15+
jobs:
16+
update-pre-commit:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
- name: Update pre-commit hooks
22+
uses: ./.github/actions/update-precommit
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
repos:
66
# C++ formatting with clang-format
77
- repo: https://github.com/pre-commit/mirrors-clang-format
8-
rev: v20.1.7
8+
rev: v20.1.8
99
hooks:
1010
- id: clang-format
1111
files: \.(cpp|hpp|c|h)$
@@ -22,7 +22,7 @@ repos:
2222

2323
# Ruff Python linter
2424
- repo: https://github.com/charliermarsh/ruff-pre-commit
25-
rev: v0.12.4
25+
rev: v0.12.5
2626
hooks:
2727
- id: ruff
2828
args: [--fix]
@@ -40,6 +40,13 @@ repos:
4040
hooks:
4141
- id: yamllint
4242

43+
# Shell script linting with shellcheck
44+
- repo: https://github.com/koalaman/shellcheck-precommit
45+
rev: v0.10.0
46+
hooks:
47+
- id: shellcheck
48+
files: \.sh$
49+
4350
# Configuration
4451
default_stages: [pre-commit]
4552
fail_fast: false

cmake/configure.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ if(UNIX)
5151
-Wnull-dereference
5252
-Wformat=2
5353
-Wmissing-declarations
54-
-Wno-c11-extensions)
54+
-Wno-c11-extensions
55+
-Wno-cast-function-type)
5556
endif(NOT APPLE)
5657
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wold-style-definition>)
5758
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wmissing-prototypes>)

cmake/json.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ExternalProject_Add(
1313
-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
1414
-DCMAKE_CXX_STANDARD_REQUIRED=ON
1515
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
16+
-DJSON_BuildTests=OFF
1617
BUILD_COMMAND
1718
"${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/ppc_json/build"
1819
--config ${CMAKE_BUILD_TYPE} --parallel

0 commit comments

Comments
 (0)