-
-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·73 lines (70 loc) · 2.13 KB
/
ci.yml
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
name: CI
on:
push:
branches:
- '*'
tags-ignore:
- v*
pull_request:
jobs:
lint:
name: 🎨 Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install code formatter
run: sudo apt-get install clang-format
- name: Check code style
run: |
find src -type f | xargs clang-format --dry-run -Werror
find test -type f | xargs clang-format --dry-run -Werror
- name: Use Node.js
uses: actions/setup-node@v2
- name: Install markdownlint
run: npm install -g markdownlint-cli
- name: Check Markdown files
run: markdownlint .
- name: Check compliance with Arduino library specification
uses: arduino/arduino-lint-action@v1
with:
library-manager: update
test:
name: 🧪 Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install GCC compiler
run: sudo apt-get install build-essential
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Use Python
uses: actions/setup-python@v2
- name: Install PlatformIO Core
run: pip install -U platformio==6.1.3
- name: Run tests
run: pio test -v
- name: Install Gcovr
run: pip install gcovr
- name: Generate code coverage
run: |
mkdir code-coverage
rm -r .pio/build/native/unity_config_build
gcovr -r . -e .pio/libdeps -e test -s
gcovr -r . -e .pio/libdeps -e test --html-details -o code-coverage/coverage.html
- name: Upload code coverage as artifact
uses: actions/upload-artifact@v2
with:
name: code-coverage
path: code-coverage