-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (117 loc) · 3.84 KB
/
main.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
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
111
112
113
114
115
116
117
name: test and build
on:
push:
branches:
- master
- test-*
schedule:
- cron: '0 0 1 * *'
permissions:
contents: read
pages: write
id-token: write
jobs:
main-job:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: install bashcov
shell: bash
run: sudo gem install bashcov simplecov-lcov
- name: apt deps
shell: bash
run: sudo apt-get install luarocks liblua5.4-dev lua5.4 lcov socat
- name: check for lua
shell: bash
run: which echo && which lua && which lua5.4 && lua -v && lua5.4 -v
- name: luarocks deps
shell: bash
run: echo luacov luacov-reporter-lcov luassert | xargs -n1 sudo luarocks install --lua-version=5.4
- name: Stylua
run: |
wget -O /tmp/stylua.zip https://github.com/JohnnyMorganz/StyLua/releases/download/v0.18.2/stylua-linux-x86_64.zip
sudo unzip /tmp/stylua.zip -d /usr/local/bin/
- name: test
run: make
# run: eval "$(luarocks --lua-version 5.4 path --bin)" && make test-all
- name: add more info
shell: bash
run: mkdir report/debug && cp *.info report/debug
- name: Upload test coverage
uses: actions/upload-artifact@v2
with:
name: coverage
path: ./report
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'report'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
- name: coverage check
shell: bash
run: make coverage-check
build-job:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get Short Git Hash
shell: bash
run: echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
# thanks https://stackoverflow.com/a/61699863
- name: apt deps
shell: bash
run: sudo apt-get install liblua5.4-dev lua5.4
- name: build
run: GIT_HASH=${{ env.sha_short }} make -C driver -f package.mk serial-keyboard.deb
- name: Upload .deb as artifact
uses: actions/upload-artifact@v2
with:
name: serial-keyboard-${{ env.sha_short }}.deb
path: ./driver/serial-keyboard.deb
subprojects-job:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- cc: gcc
option:
- cc: clang
option: CC=clang
steps:
- name: Checkout
uses: actions/checkout@v3
- name: apt deps
shell: bash
run: sudo apt-get install luarocks liblua5.4-dev lua5.4 socat
- name: check for lua
shell: bash
run: which echo && which lua && which lua5.4 && lua -v && lua5.4 -v
- name: luarocks deps
shell: bash
run: sudo luarocks install --lua-version=5.4 luassert
- name: test firmware subproject
run: make -C firmware test ${{ matrix.option }}
- name: test driver subproject
run: make -C driver test ${{ matrix.option }}
- name: ${{ matrix.cc }} check
shell: bash
run: find . -name '*.o' | xargs readelf -p .comment | grep -i ${{ matrix.cc }}
- name: only ${{ matrix.cc }} check
shell: bash
run: |
OTHER_COMPILER=$(echo clang gcc | xargs -n1 echo | grep -v ${{ matrix.cc }})
echo make sure we are not accidentally using $OTHER_COMPILER
! find . -name '*.o' | xargs readelf -p .comment | grep -i $OTHER_COMPILER
- name: no runtime or compiletime coverage info
shell: bash
run: |
! find . -name 'luacov*' -o -name '*.gc*' | grep '.'