Skip to content

Commit ddd776b

Browse files
authored
ci: refactor workflows (#79)
* ci: replace `debug` and `debug-msvc` jobs with `test.yaml` workflow * ci: refactor `build.yaml` workflow * ci: refactor `deploy.yaml` workflow
1 parent 9f7a7ba commit ddd776b

File tree

5 files changed

+115
-118
lines changed

5 files changed

+115
-118
lines changed

.github/workflows/build.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
jobs:
8+
build-project:
9+
name: Build Project
10+
runs-on: ${{ matrix.os }}-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ubuntu, windows]
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4.1.1
18+
19+
- name: Configure Project
20+
uses: threeal/cmake-action@v1.3.0
21+
22+
- name: Build Project
23+
run: cmake --build build --config Release
24+
25+
build-docs:
26+
name: Build Documentation
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4.1.1
31+
32+
- name: Install Requirements
33+
run: pip3 install -r docs/requirements.txt
34+
35+
- name: Build Documentation
36+
run: sphinx-build -b html docs build/docs -W --keep-going
37+
38+
- name: Upload Documentation
39+
uses: actions/upload-pages-artifact@v3.0.0
40+
with:
41+
path: build/docs

.github/workflows/build.yml

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

.github/workflows/deploy.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
name: deploy
1+
name: Deploy
22
on:
33
workflow_dispatch:
44
push:
55
branches: [main]
6-
permissions:
7-
contents: read
8-
pages: write
9-
id-token: write
10-
concurrency:
11-
group: pages
12-
cancel-in-progress: false
136
jobs:
14-
docs:
7+
deploy-pages:
8+
name: Deploy Pages
159
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
pages: write
1613
environment:
1714
name: github-pages
18-
url: ${{ steps.deployment.outputs.page_url }}
15+
url: ${{ steps.deploy-pages.outputs.page_url }}
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: true
1919
steps:
20+
- name: Setup Pages
21+
uses: actions/configure-pages@v4.0.0
22+
2023
- name: Checkout
2124
uses: actions/checkout@v4.1.1
2225

23-
- name: Install requirements
26+
- name: Install Requirements
2427
run: pip3 install -r docs/requirements.txt
2528

26-
- name: Setup Pages
27-
uses: actions/configure-pages@v4.0.0
28-
29-
- name: Build with Sphinx
29+
- name: Build Documentation
3030
run: sphinx-build -b html docs docs/build -W --keep-going
3131

32-
- name: Upload artifact
32+
- name: Upload Documentation
3333
uses: actions/upload-pages-artifact@v3.0.0
3434
with:
3535
path: docs/build
3636

37-
- name: Deploy to GitHub Pages
38-
id: deployment
37+
- name: Deploy Pages
38+
id: deploy-pages
3939
uses: actions/deploy-pages@v4.0.0

.github/workflows/test.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Test
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
jobs:
8+
check-project:
9+
name: Check Project
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4.1.1
14+
15+
- name: Configure Project
16+
uses: threeal/cmake-action@v1.3.0
17+
with:
18+
options: BUILD_TESTING=ON
19+
20+
- name: Check Format
21+
run: |
22+
cmake --build build --target format
23+
git diff --exit-code HEAD
24+
25+
test-project:
26+
name: Test Project
27+
runs-on: ${{ matrix.os }}-latest
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
os: [ubuntu, windows]
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4.1.1
35+
36+
- name: Configure Project
37+
uses: threeal/cmake-action@v1.3.0
38+
with:
39+
options: BUILD_TESTING=ON
40+
41+
- name: Build Project
42+
run: cmake --build build
43+
44+
- name: Test Project
45+
run: ctest --test-dir build --output-on-failure --no-tests=error
46+
47+
- name: Check Coverage
48+
if: ${{ matrix.os != 'windows' }}
49+
uses: threeal/gcovr-action@v1.0.0
50+
with:
51+
excludes: |
52+
build/*
53+
test/*
54+
fail-under-line: 100

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Error C++
22

3-
[![build status](https://img.shields.io/github/actions/workflow/status/threeal/errors-cpp/build.yml?branch=main)](https://github.com/threeal/errors-cpp/actions/workflows/build.yml)
3+
[![build status](https://img.shields.io/github/actions/workflow/status/threeal/errors-cpp/build.yaml?branch=main)](https://github.com/threeal/errors-cpp/actions/workflows/build.yaml)
4+
[![test status](https://img.shields.io/github/actions/workflow/status/threeal/errors-cpp/test.yaml?branch=main&&label=test)](https://github.com/threeal/errors-cpp/actions/workflows/test.yaml)
45
[![deploy status](https://img.shields.io/github/actions/workflow/status/threeal/errors-cpp/deploy.yaml?branch=main&label=deploy)](https://github.com/threeal/errors-cpp/actions/workflows/deploy.yaml)
56

67
A C++ package that provides utilities for error handling.

0 commit comments

Comments
 (0)