Skip to content

Commit 71dc7f5

Browse files
authored
ci: divide workflow into build and test workflows (#80)
* ci: separate workflows for build and test * ci(test): separate check formatting steps to `check-project` job * ci: rename steps to use uppercased names
1 parent b99c8ef commit 71dc7f5

File tree

3 files changed

+43
-24
lines changed

3 files changed

+43
-24
lines changed

.github/workflows/build.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/[email protected]
14+
15+
- name: Configure Project
16+
uses: threeal/[email protected]
17+
18+
- name: Build Project
19+
run: cmake --build build
20+
21+
- name: Install Project
22+
run: cmake --install build --prefix install
23+
24+
- name: Upload Project as Artifact
25+
uses: actions/[email protected]
26+
with:
27+
path: install

.github/workflows/ci.yaml renamed to .github/workflows/test.yaml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,46 @@
1-
name: CI
1+
name: Test
22
on:
33
workflow_dispatch:
44
pull_request:
55
push:
66
branches: [main]
77
jobs:
8-
build-release:
9-
name: Build Release
8+
check-project:
9+
name: Check Project
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
1313
uses: actions/[email protected]
1414

15-
- name: Configure project
15+
- name: Configure Project
1616
uses: threeal/[email protected]
17-
18-
- name: Build project
19-
run: cmake --build build
20-
21-
- name: Install project
22-
run: cmake --install build --prefix install
23-
24-
- name: Upload project as artifact
25-
uses: actions/[email protected]
2617
with:
27-
path: install
18+
options: BUILD_TESTING=ON
2819

29-
build-testing:
30-
name: Build Testing
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
3127
runs-on: ubuntu-latest
3228
steps:
3329
- name: Checkout
3430
uses: actions/[email protected]
3531

36-
- name: Configure project
32+
- name: Configure Project
3733
uses: threeal/[email protected]
3834
with:
3935
options: BUILD_TESTING=ON
4036

41-
- name: Check formatting
42-
run: |
43-
cmake --build build --target format
44-
git diff --exit-code HEAD
45-
4637
- name: Build Project
4738
run: cmake --build build
4839

4940
- name: Test Project
5041
run: ctest --test-dir build --output-on-failure --no-tests=error
5142

52-
- name: Check coverage
43+
- name: Check Coverage
5344
uses: threeal/[email protected]
5445
with:
5546
excludes: build/*

README.md

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

3-
[![build status](https://img.shields.io/github/actions/workflow/status/threeal/cpp-starter/ci.yaml?branch=main&style=flat-square)](https://github.com/threeal/cpp-starter/actions/workflows/ci.yaml)
3+
[![build status](https://img.shields.io/github/actions/workflow/status/threeal/cpp-starter/build.yaml?branch=main&style=flat-square)](https://github.com/threeal/cpp-starter/actions/workflows/build.yaml)
4+
[![test status](https://img.shields.io/github/actions/workflow/status/threeal/cpp-starter/test.yaml?branch=main&label=test&style=flat-square)](https://github.com/threeal/cpp-starter/actions/workflows/test.yaml)
45

56
The C++ Starter is a [GitHub repository template](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template) that provides a minimalistic boilerplate to kickstart your [C++](https://isocpp.org) project. This template offers a streamlined foundation, complete with predefined file structures, essential tools, and recommended settings, ensuring a swift and efficient start to your C++ development journey.

0 commit comments

Comments
 (0)