Skip to content

Update prepare release workflow #5

Update prepare release workflow

Update prepare release workflow #5

name: Build Arduino Library Examples
on:
workflow_call:
inputs:
boards_to_build:
description: 'A comma-separated list of PlatformIO board names to build'
default: ""
required: false
type: string
examples_to_build:
description: 'A comma-separated list of examples to build'
default: ""
required: false
type: string
jobs:
generate_scripts:
name: Generate Install and Build Scripts
runs-on: ubuntu-latest
if: ${{ ! contains(github.event.head_commit.message, 'ci skip') }}
outputs:
arduino_job_matrix: ${{ steps.py_matrix.outputs.arduino_job_matrix }}
pio_job_matrix: ${{ steps.py_matrix.outputs.pio_job_matrix }}
env:
BOARDS_TO_BUILD: ${{ inputs.boards_to_build }}
EXAMPLES_TO_BUILD: ${{ inputs.examples_to_build }}
steps:
- name: Checkout code
- uses: actions/checkout@v4
- name: Setup PlatformIO
uses: EnviroDIY/[email protected]
- name: Generate Platform Installation Script
id: py_platforms
run: |
echo "Generating script to install Platforms"
curl -SL https://raw.githubusercontent.com/EnviroDIY/workflows/main/scripts/generate_platform_installation_script.py -o generate_platform_installation_script.py
python -u generate_platform_installation_script.py
- name: Generate Library Installation Script
id: py_libraries
run: |
set -e
if [ "$RUNNER_DEBUG" = "1" ]; then
echo "Enabling debugging!"
set -v
set -x
fi
if [ ! -e continuous_integration/install-libraries-platformio.sh ] && [ ! -e continuous_integration/install-libraries-arduino-cli.sh ]
then
echo "Generating dependency library installation script"
curl -SL https://raw.githubusercontent.com/EnviroDIY/workflows/main/scripts/generate_library_installation_script.py -o generate_library_installation_script.py
python -u generate_library_installation_script.py
else
echo "Dependency installation script found"
fi
- name: Generate Example Build Matrices
id: py_matrix
run: |
if [ -e continuous_integration/generate_job_matrix.py ]
then
echo "Generating job matrix from library specific generator code"
python -u continuous_integration/generate_job_matrix.py
else
echo "Generating job matrix from standard workflow"
curl -SL https://raw.githubusercontent.com/EnviroDIY/workflows/main/scripts/generate_job_matrix.py -o generate_job_matrix.py
python -u generate_job_matrix.py
fi
- name: Store generated examples
uses: actions/upload-artifact@v4
with:
name: generated_scripts
path: |
continuous_integration_artifacts/
determine_library_source:
name: Determine the source of the testing library
uses: ./.github/workflows/determine_library_source.yaml
build_ex_arduino:
name: Build Examples with Arduino CLI
needs: [determine_library_source, generate_scripts]
uses: ./.github/workflows/compile_arduino_cli.yaml
with:
library_install_zip: ${{ needs.determine_library_source.outputs.library_install_zip }}
arduino_job_matrix: ${{ needs.generate_scripts.outputs.arduino_job_matrix }}
build_pio:
name: Build Examples with PlatformIO
needs: [determine_library_source, generate_scripts]
uses: ./.github/workflows/compile_platformio.yaml
with:
library_install_git: ${{ needs.determine_library_source.outputs.library_install_git }}
pio_job_matrix: ${{ needs.generate_scripts.outputs.pio_job_matrix }}