Build OSW-OS (Ubuntu, Windows, Mac OS, all models) #477
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: actions/checkout@v3 # incompatible with git lfs cache bandwidth calcs (https://github.com/actions/checkout/issues/165) | |
uses: nschloe/action-cached-lfs-checkout@v1.2.1 | |
with: | |
submodules: recursive | |
- uses: dorny/paths-filter@v2.11.1 | |
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: actions/checkout@v3 # incompatible with git lfs cache bandwidth calcs (https://github.com/actions/checkout/issues/165) | |
uses: nschloe/action-cached-lfs-checkout@v1.2.1 | |
with: | |
submodules: recursive | |
- name: Cache pip | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: pip-${{ runner.os }} | |
- name: Cache PlatformIO | |
uses: actions/cache@v3 | |
with: | |
path: ~/.platformio | |
key: platformio-${{ runner.os }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install PlatformIO | |
shell: bash | |
run: | | |
apt update && apt -y install swig | |
python -m pip install --upgrade pip | |
pip install --upgrade platformio | |
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 |