-
Notifications
You must be signed in to change notification settings - Fork 1
110 lines (102 loc) · 4.17 KB
/
Copy pathci.yml
File metadata and controls
110 lines (102 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- cc: gcc
c_standard: 99
- cc: gcc
c_standard: 11
- cc: clang
c_standard: 99
- cc: clang
c_standard: 11
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure
run: cmake -S . -B build -DMICROTIMER_BUILD_TESTS=ON -DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_C_STANDARD=${{ matrix.c_standard }}
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
linux-sanitizers:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sanitize:
- address
- undefined
- address,undefined
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure
run: cmake -S . -B build -DMICROTIMER_BUILD_TESTS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_C_FLAGS="-fsanitize=${{ matrix.sanitize }} -fno-omit-frame-pointer"
- name: Build
run: cmake --build build
- name: Test
run: ctest --test-dir build --output-on-failure
linux-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Install optional tools
run: sudo apt-get update && sudo apt-get install -y clang-tidy cppcheck clang-tools
- name: Strict configure
run: cmake -S . -B build -DMICROTIMER_BUILD_TESTS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_C_FLAGS="-Wconversion -Wsign-conversion -fshort-enums"
- name: Build
run: cmake --build build
- name: Clang static analyzer
run: scan-build --status-bugs cmake --build build
- name: Clang tidy
run: clang-tidy src/mtimer.c -- -Iinclude
- name: Cppcheck
run: cppcheck --enable=warning,style,performance --error-exitcode=1 include src tests/test_all.c tests/consumers tests/find_package_consumer tests/add_subdirectory_consumer
windows-msvc:
runs-on: windows-2022
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Configure, build, and test with MSVC
shell: pwsh
run: |
$vswhere = Join-Path ${env:ProgramFiles(x86)} "Microsoft Visual Studio\Installer\vswhere.exe"
$installationPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if (-not $installationPath) {
throw "No Visual Studio installation with MSVC tools was found."
}
$devCmd = Join-Path $installationPath "Common7\Tools\VsDevCmd.bat"
$command = "`"$devCmd`" -arch=x64 && cmake -S . -B build -G Ninja -DMICROTIMER_BUILD_TESTS=ON -DCMAKE_C_COMPILER=cl -DCMAKE_C_FLAGS:STRING=`"/W4 /WX`" && cmake --build build && ctest --test-dir build --output-on-failure"
cmd /c $command
install-consumers:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Install package
run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX="$PWD/stage" && cmake --build build && cmake --install build
- name: find_package consumer
run: cmake -S tests/find_package_consumer -B build-find -DCMAKE_PREFIX_PATH="$PWD/stage" && cmake --build build-find
- name: add_subdirectory consumer
run: cmake -S tests/add_subdirectory_consumer -B build-subdir && cmake --build build-subdir
arm-cross:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
cpu:
- cortex-m0
- cortex-m0plus
- cortex-m4
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Install ARM toolchain
run: sudo apt-get update && sudo apt-get install -y gcc-arm-none-eabi
- name: Compile only
run: arm-none-eabi-gcc -std=c99 -Wall -Wextra -Werror -mcpu=${{ matrix.cpu }} -mthumb -Iinclude -c src/mtimer.c -o mtimer-${{ matrix.cpu }}.o