Skip to content

Merge pull request #626 from davepl/main #1041

Merge pull request #626 from davepl/main

Merge pull request #626 from davepl/main #1041

Workflow file for this run

name: PlatformIO CI
on: [push, pull_request, workflow_dispatch]
jobs:
collect-environments:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Find environments
id: envs
run: |
if [[ $(< config/ci_exclude.json) != '[]' ]]; then echo "::warning title=Some environments were skipped::Environments not built: $(< config/ci_exclude.json)"; fi
echo "envs=$(tools/show_envs.py | jq -c --argfile ex config/ci_exclude.json '. - $ex')" >> $GITHUB_OUTPUT
outputs:
envs: ${{ steps.envs.outputs.envs }}
build-environment:
runs-on: ubuntu-latest
needs: [collect-environments]
strategy:
fail-fast: false
matrix:
envname: ${{ fromJson(needs.collect-environments.outputs.envs) }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install PlatformIO
run: |
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py
python get-platformio.py
echo "/home/runner/.platformio/penv/bin" >> $GITHUB_PATH
- name: Copy secrets and clear SSID
run: |
grep -v "^#define cszSSID" include/secrets.example.h > include/secrets.h
echo '#define cszSSID ""' >> include/secrets.h
- name: "Build environment: ${{ matrix.envname }}"
run: pio run -e ${{ matrix.envname }}
build-and-publish-installer:
if: ( github.repository_owner == 'PlummersSoftwareLLC' && github.ref == 'refs/heads/main' ) || ( github.repository_owner == 'rbergen' && github.ref == 'refs/heads/staging' )
runs-on: ubuntu-latest
needs: [build-environment]
env:
PLATFORMIO_CORE_DIR: ${{ github.workspace }}/.platformio
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
remove-android: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
remove-dotnet: 'true'
remove-haskell: 'true'
- uses: actions/checkout@v4
- name: Install PlatformIO
run: |
curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py
python get-platformio.py
echo "${PLATFORMIO_CORE_DIR}/penv/bin" >> $GITHUB_PATH
- name: Copy secrets and clear SSID
run: |
grep -v "^#define cszSSID" include/secrets.example.h > include/secrets.h
echo '#define cszSSID ""' >> include/secrets.h
- name: Build web installer environments and installer
run: |
python tools/bake_installer.py
touch WebInstaller/.nojekyll
- name: Push to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: pages
folder: WebInstaller