Skip to content

Commit 10d43f3

Browse files
committed
fix(ci): repair build and docs workflows
build.yml: - Enable tests (-DBML_BUILD_TESTS=ON) and add ctest step - Update upload-artifact to v4 docs.yml: - Replace nonexistent requirements.txt with pip install .[dev] from pyproject.toml - Update all actions to current major versions (setup-python v5, cache v4, configure-pages v4, upload-pages-artifact v3, deploy-pages v4) - Remove broken jobs: lychee link-check (pip install lychee is invalid), bandit security scan (irrelevant for C++ project), metrics (wrong output), and no-op notify - Add deployment environment for GitHub Pages
1 parent 429e7a3 commit 10d43f3

2 files changed

Lines changed: 82 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,21 @@ jobs:
5151
-DCMAKE_BUILD_TYPE=${{ matrix.configuration }}
5252
-DVIRTOOLS_SDK_PATH=${{ github.workspace }}/Virtools-SDK-2.1
5353
-DCMAKE_INSTALL_PREFIX=${{ env.BASE_DIST_DIR }}/${{ matrix.configuration }}
54+
-DBML_BUILD_TESTS=ON
5455
5556
- name: Build the project
5657
run: cmake --build ${{ env.BASE_BUILD_DIR }}/${{ matrix.configuration }} --config ${{ matrix.configuration }}
5758

59+
- name: Run tests
60+
run: ctest --test-dir ${{ env.BASE_BUILD_DIR }}/${{ matrix.configuration }} -C ${{ matrix.configuration }} --output-on-failure
61+
5862
- name: Install binaries to distribution folder
5963
run: >
6064
cmake --install ${{ env.BASE_BUILD_DIR }}/${{ matrix.configuration }}
6165
--prefix ${{ env.BASE_DIST_DIR }}/${{ matrix.configuration }} --config ${{ matrix.configuration }}
6266
6367
- name: Upload build artifacts
64-
uses: actions/upload-artifact@v4.3.3
68+
uses: actions/upload-artifact@v4
6569
with:
6670
name: ${{ env.PROJECT_NAME }}-${{ env.GIT_SHA }}-${{ matrix.configuration }}
6771
path: ${{ env.BASE_DIST_DIR }}/${{ matrix.configuration }}

.github/workflows/docs.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Documentation
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- 'mkdocs.yml'
9+
- 'pyproject.toml'
10+
- '.github/workflows/docs.yml'
11+
pull_request:
12+
branches: [ main ]
13+
paths:
14+
- 'docs/**'
15+
- 'mkdocs.yml'
16+
- 'pyproject.toml'
17+
- '.github/workflows/docs.yml'
18+
workflow_dispatch:
19+
20+
permissions:
21+
contents: read
22+
pages: write
23+
id-token: write
24+
25+
concurrency:
26+
group: "pages"
27+
cancel-in-progress: false
28+
29+
jobs:
30+
build:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
38+
- name: Setup Python
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: '3.12'
42+
43+
- name: Cache pip
44+
uses: actions/cache@v4
45+
with:
46+
path: ~/.cache/pip
47+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
48+
restore-keys: |
49+
${{ runner.os }}-pip-
50+
51+
- name: Install dependencies
52+
run: pip install ".[dev]"
53+
54+
- name: Build documentation
55+
run: mkdocs build --clean --strict
56+
57+
- name: Setup Pages
58+
if: github.ref == 'refs/heads/main'
59+
uses: actions/configure-pages@v4
60+
61+
- name: Upload artifact
62+
if: github.ref == 'refs/heads/main'
63+
uses: actions/upload-pages-artifact@v3
64+
with:
65+
path: ./site
66+
67+
deploy:
68+
runs-on: ubuntu-latest
69+
needs: build
70+
if: github.ref == 'refs/heads/main'
71+
environment:
72+
name: github-pages
73+
url: ${{ steps.deployment.outputs.page_url }}
74+
steps:
75+
- name: Deploy to GitHub Pages
76+
id: deployment
77+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)