Skip to content

Commit bfaef56

Browse files
committed
Add pre-commit and ctest for github action.
1 parent b893f8e commit bfaef56

File tree

4 files changed

+73
-1
lines changed

4 files changed

+73
-1
lines changed

.github/workflows/ctest.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: ctest
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
jobs:
8+
ctest:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: dependencies
15+
run: sudo apt-get update && sudo apt-get install -y libgtest-dev
16+
17+
- name: mkdir
18+
run: mkdir ${{runner.workspace}}/build
19+
20+
- name: configure
21+
run: cmake -S ${{github.workspace}} -B ${{runner.workspace}}/build
22+
23+
- name: build
24+
run: cmake --build ${{runner.workspace}}/build --target test_executables
25+
26+
- name: ctest
27+
run: ctest --test-dir ${{runner.workspace}}/build

.github/workflows/example.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: examples
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
jobs:
8+
cxx:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: dependencies
15+
run: sudo apt-get update && sudo apt-get install -y libgtest-dev
16+
17+
- name: mkdir
18+
run: mkdir ${{runner.workspace}}/build
19+
20+
- name: configure
21+
run: cmake -S ${{github.workspace}} -B ${{runner.workspace}}/build
22+
23+
- name: build
24+
run: cmake --build ${{runner.workspace}}/build --target main
25+
26+
- name: run
27+
run: ${{runner.workspace}}/build/main

.github/workflows/pre-commit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
pre-commit:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: pre-commit/[email protected]

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,8 @@ fallback_version = "0.0.0"
1919

2020
[tool.scikit-build]
2121
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
22-
build.verbose = true
22+
build.verbose = true
23+
24+
[tool.yapf]
25+
based_on_style = "google"
26+
column_limit = 200

0 commit comments

Comments
 (0)