-
Notifications
You must be signed in to change notification settings - Fork 1
176 lines (143 loc) · 6.03 KB
/
build_windows.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Windows
on: [push, pull_request]
env:
PlatformToolset: v142
# build platform, i.e. x86, x64, Any CPU. This setting is optional.
Platform: Win32
# build Configuration, i.e. Debug, Release, etc.
Configuration: Release
jobs:
build:
# For a list of available runner types, refer to
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure GIT
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: |
git config --local core.autocrlf true
git config --local advice.detachedHead false
git submodule update --init --recursive
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Create new environment variables
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: |
python -c "import os; print('GIT_REPOSITORY=' + os.path.split(os.getenv('GITHUB_REPOSITORY'))[1]);" >> %GITHUB_ENV%
python -c "import os; print('GIT_BRANCH=' + os.path.split(os.getenv('GITHUB_REF'))[1]);" >> %GITHUB_ENV%
echo GITHUB_WORKFLOW=%GITHUB_WORKFLOW%>> %GITHUB_ENV%
- name: List environment variables for debugging
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: |
set
- name: Deploy 'tests not available' badge before building
#uses: exuanbo/actions-deploy-gist@v1
uses: end2endzone/actions-deploy-gist@main
with:
token: ${{ secrets.BADGES }}
gist_id: 58cf6c72c08e706335337d5ef9ca48e8
gist_file_name: ${{env.GIT_REPOSITORY}}.${{env.GIT_BRANCH}}.${{env.GITHUB_WORKFLOW}}.json
file_path: ./ci/github/tests_not_available.badge.json
- name: Install yamlpath
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\install_yamlpath.bat
- name: Install Arduino CLI
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\install_arduinocli.bat
- name: Install Arduino cores
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\install_arduino_cores.bat
- name: Install Arduino library dependencies
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\arduino_install_libraries.bat
- name: Install this arduino library
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\install_this.bat
- name: Install Google Test
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\install_googletest.bat
- name: Install RapidAssist
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\install_rapidassist.bat
- name: Install win32arduino
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\install_win32arduino.bat
- name: Build library
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\build_library.bat
- name: Build Arduino sketch - Basic
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\arduino_build_sketch.bat Basic
- name: Build Arduino sketch - BlockingWithNonBlocking
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\arduino_build_sketch.bat BlockingWithNonBlocking
- name: Build Arduino sketch - NonBlockingDemo
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\arduino_build_sketch.bat NonBlockingDemo
- name: Build Arduino sketch - NonBlockingInterruptedDemo
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\arduino_build_sketch.bat NonBlockingInterruptedDemo
- name: Build Arduino sketch - Play10Bits
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\arduino_build_sketch.bat Play10Bits
- name: Build Arduino sketch - Play16Bits
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\arduino_build_sketch.bat Play16Bits
- name: Build Arduino sketch - ProgramMemoryRtttl
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\arduino_build_sketch.bat ProgramMemoryRtttl
- name: Build Arduino sketch - Rtttl2Code
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\arduino_build_sketch.bat Rtttl2Code
- name: Run unit tests
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\test_script.bat
- name: Search unit test report file
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: |
for /f "tokens=* usebackq" %%f in (`dir/b/s build\bin\${{env.configuration}}\anyrtttl_unittest*.xml`) do (set UNITTEST_REPORT_PATH=%%f)
echo UNITTEST_REPORT_PATH=%UNITTEST_REPORT_PATH%
echo UNITTEST_REPORT_PATH=%UNITTEST_REPORT_PATH% >> %GITHUB_ENV%
- name: Create test badge
working-directory: ${{env.GITHUB_WORKSPACE}}
run: python ci\github\maketestbadge.py ${{env.UNITTEST_REPORT_PATH}}
- name: Deploy test badge to gist
#uses: exuanbo/actions-deploy-gist@v1
uses: end2endzone/actions-deploy-gist@main
with:
token: ${{ secrets.BADGES }}
gist_id: 58cf6c72c08e706335337d5ef9ca48e8
gist_file_name: ${{env.GIT_REPOSITORY}}.${{env.GIT_BRANCH}}.${{env.GITHUB_WORKFLOW}}.json
file_path: ./badge.json
- name: Archive test results
uses: actions/[email protected]
with:
name: unit-test-results
path: build\bin\${{env.Configuration}}\anyrtttl_unittest*.xml