Skip to content

Commit 7c32efe

Browse files
shenxianpeng2bndy5
andauthored
fix test CI issue by calling self test action (#217)
* Checkout pull request HEAD commit * Update run-test.yml * Update run-test.yml * updaste run-test.yml * change pull_request_target to pull_request * change git tag command * change pull_request_target to pull_request * delete tag before create * change git tag commands * cancel previours build when trigger a new build * update step name * update concurrency group * don't arbitrarily ignore errors * Update run-test.yml * support workflow_dispatch event * add a self test action * Update self-test.yml * remove run-test.yml * ignore venv folder * add step-summary to test * Update .github/workflows/self-test.yml Co-authored-by: Brendan <[email protected]> * Update .github/workflows/self-test.yml Co-authored-by: Brendan <[email protected]> * Update .github/workflows/self-test.yml Co-authored-by: Brendan <[email protected]> * Update .github/workflows/self-test.yml Co-authored-by: Brendan <[email protected]> --------- Co-authored-by: Brendan <[email protected]>
1 parent 1423120 commit 7c32efe

File tree

3 files changed

+71
-33
lines changed

3 files changed

+71
-33
lines changed

.github/workflows/run-test.yml

-33
This file was deleted.

.github/workflows/self-test.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Self test action
2+
3+
on:
4+
push:
5+
branches: main
6+
paths-ignore: "docs/**"
7+
pull_request:
8+
branches: main
9+
paths-ignore: "docs/**"
10+
11+
jobs:
12+
test:
13+
strategy:
14+
matrix:
15+
os: [ ubuntu-latest, macos-latest, windows-latest ]
16+
clang-version: ['9','10', '11', '12', '13', '14', '15', '16', '17', '18']
17+
fail-fast: false
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Cache the build artifacts
24+
id: cache-build
25+
uses: actions/cache@v4
26+
with:
27+
path: build
28+
key: ${{ runner.os }}-${{ hashFiles('docs/examples/demo/**') }}
29+
30+
- name: Generate compilation database
31+
if: steps.cache-build.outputs.cache-hit != 'true'
32+
run: mkdir build && cmake -Bbuild docs/examples/demo
33+
34+
- name: Self test action
35+
uses: ./
36+
id: linter
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
with:
40+
style: file
41+
files-changed-only: false
42+
# to ignore all build folder contents
43+
ignore: build|venv
44+
database: build
45+
verbosity: debug
46+
version: ${{ matrix.clang-version }}
47+
thread-comments: ${{ matrix.clang-version == '12' && 'update' }}
48+
file-annotations: ${{ runner.os == 'Linux' && matrix.clang-version == '12' }}
49+
step-summary: ${{ matrix.clang-version == '12' }}
50+
extra-args: -std=c++14 -Wall
51+
52+
- name: Fail fast?!
53+
# if: steps.linter.outputs.checks-failed > 0
54+
run: |
55+
echo "some linter checks failed"
56+
echo "${{ steps.linter.outputs.checks-failed }}"
57+
echo "${{ env.checks-failed }}"
58+
# for actual deployment
59+
# run: exit 1

docs/examples/demo/CMakeLists.txt

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
cmake_minimum_required(VERSION 3.15)
2+
3+
# Set the project name to your project name
4+
project(demo C CXX)
5+
6+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
7+
8+
add_executable(demo_app
9+
${CMAKE_BINARY_SOURCE_DIR}demo.hpp
10+
${CMAKE_BINARY_SOURCE_DIR}demo.cpp
11+
)
12+
target_include_directories(demo_app PUBLIC ${CMAKE_BINARY_SOURCE_DIR})

0 commit comments

Comments
 (0)