-
Notifications
You must be signed in to change notification settings - Fork 163
82 lines (78 loc) · 2.73 KB
/
test-OS.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
name: Build OSW-OS (Ubuntu, Windows, Mac OS, all models)
on:
workflow_dispatch:
pull_request:
schedule:
- cron: "0 0 * * *"
jobs:
Find-feature:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: nschloe/action-cached-lfs-checkout@v1
with:
submodules: recursive
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
i8n:
- 'include/locales/*.h'
- id: get_lang
run: |
if [ ${{ steps.filter.outputs.i8n }} == "true" ]; then
echo "get-languages=$(python3 .github/getWorkflowMatrix.py all_languages)" >> $GITHUB_OUTPUT
else
echo "get-languages=$(python3 .github/getWorkflowMatrix.py default_language)" >> $GITHUB_OUTPUT
fi
- id: get_mod
run: |
echo "get-models=$(python3 .github/getWorkflowMatrix.py all_models)" >> $GITHUB_OUTPUT
outputs:
get-models: ${{ steps.get_mod.outputs.get-models }}
get-languages: ${{ steps.get_lang.outputs.get-languages }}
build-OSW:
needs: Find-feature
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
model: ${{ fromJson(needs.Find-feature.outputs.get-models) }}
language: ${{ fromJson(needs.Find-feature.outputs.get-languages) }}
steps:
- name: Checkout repository and submodules
uses: nschloe/action-cached-lfs-checkout@v1
with:
submodules: recursive
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: platformio-${{ runner.os }}
- name: Install swig on Linux
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get -y install swig
- name: Install swig on Mac OS
if: matrix.os == 'macos-latest'
run: brew install swig
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install PlatformIO
run: python -m pip install --upgrade pip && pip install --upgrade platformio
- name: Rename config
run: mv include/config.h.example include/config.h
- name: Compile language ${{ matrix.language }} model ${{ matrix.model }}
run: python3 .github/buildFirmware.py -l "${{ matrix.language }}" -m "${{ matrix.model }}" -b debug
- name: Upload ${{ matrix.os }} firmware artifacts
uses: actions/upload-artifact@v4
with:
name: firmwares-${{ matrix.os }}
path: "*.bin"