| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309 |
- # This is the name of the workflow, visible on GitHub UI.
- name: TaskScheduler Examples Build
- # Controls when the action will run.
- on:
- # Triggers the workflow on push or pull request only for the main branch
- push:
- branches: [ master, main ]
- paths:
- - 'examples/**'
- - 'src/**'
- - 'tests/**'
- pull_request:
- branches: [ master, main ]
- paths:
- - 'examples/**'
- - 'src/**'
- - 'tests/**'
- workflow_dispatch:
- # This is the list of jobs that will be run concurrently.
- # Since we use a build matrix, the actual number of jobs
- # started depends on how many configurations the matrix
- # will produce.
- jobs:
- # This is the name of the job - can be whatever.
- ArduinoIDE_AVR:
- # Here we tell GitHub that the jobs must be determined
- # dynamically depending on a matrix configuration.
- strategy:
- matrix:
- # The matrix will produce one job for each configuration
- # parameter of type `arduino-platform`, in this case, it
- # is only 1.
- arduino-platform: ["arduino:avr"]
- # This is usually optional but we need to statically define the
- # FQBN of the boards we want to test for each platform. In the
- # future the CLI might automatically detect and download the
- # core needed to compile against a certain FQBN, at that point
- # the following `include` section will be useless.
- fqbn: ["arduino:avr:uno"]
- example:
- - "Scheduler_example00_Blink"
- - "Scheduler_example00_Blink_Namespace"
- - "Scheduler_example01"
- - "Scheduler_example02"
- - "Scheduler_example03"
- - "Scheduler_example04_StatusRequest"
- - "Scheduler_example05_StatusRequest"
- - "Scheduler_example06_IDLE"
- - "Scheduler_example07_WDT"
- - "Scheduler_example08_LTS"
- - "Scheduler_example09_TimeCritical"
- - "Scheduler_example10_Benchmark"
- - "Scheduler_example11_Priority"
- - "Scheduler_example12_Priority"
- - "Scheduler_example13_Micros"
- - "Scheduler_example16_Multitab"
- - "Scheduler_example17_Timeout"
- - "Scheduler_example18_StatusRequest_LTS_WDT_Timeout"
- - "Scheduler_example19_Dynamic_Tasks"
- - "Scheduler_example19_Dynamic_Tasks_SelfDestruct"
- - "Scheduler_example20_StatusRequest_LTS_WDT_Timeout_Object"
- - "Scheduler_example21_OO_Callbacks"
- - "Scheduler_example23_IDLE_Callback"
- - "Scheduler_example24_CPU_LOAD"
- - "Scheduler_example25_SCHEDULER_CHAIN"
- - "Scheduler_example26_SCHEDULING_OPTIONS"
- - "Scheduler_example28_Tickless"
- # This is the platform GitHub will use to run our workflow,
- # I picked ubuntu.
- runs-on: ubuntu-latest
- # This is the list of steps this job will run.
- steps:
- # First of all, we clone the repo using the `checkout` action.
- - name: Checkout
- uses: actions/checkout@main
- # We use the `arduino/setup-arduino-cli` action to install and
- # configure the Arduino CLI on the system.
- - name: Setup Arduino CLI
- uses: arduino/setup-arduino-cli@v1.1.1
-
-
- # We then install the platform, which one will be determined
- # dynamically by the build matrix.
- - name: Install platform
- run: |
- arduino-cli core update-index
- arduino-cli core install ${{ matrix.arduino-platform }}
- - name: Install repo as library
- run: |
- mkdir -p "$HOME/Arduino/libraries"
- ln -s "$PWD" "$HOME/Arduino/libraries/."
- - name: Install required libraries
- run: |
- mkdir -p "$HOME/Arduino/libraries"
- # Install QueueArray from Arduino Playground
- wget -O queuearray.zip https://playground.arduino.cc/uploads/Code/QueueArray/index.zip
- unzip queuearray.zip -d "$HOME/Arduino/libraries/"
- # Install MemoryFree library from Arduino Library Manager
- git clone https://github.com/McNeight/MemoryFree.git
- cp -r MemoryFree "$HOME/Arduino/libraries/"
-
- # Finally, we compile the sketch, using the FQBN that was set
- # in the build matrix.
- - name: Compile ${{ matrix.example }}
- run: arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/${{ matrix.example }} --warnings more
- ArduinoIDE_ESP32:
- strategy:
- matrix:
- arduino-platform: ["esp32:esp32"]
- fqbn: ["esp32:esp32:esp32"]
- example:
- - "Scheduler_example00_Blink"
- - "Scheduler_example00_Blink_Namespace"
- - "Scheduler_example01"
- - "Scheduler_example02"
- - "Scheduler_example03"
- - "Scheduler_example04_StatusRequest"
- - "Scheduler_example05_StatusRequest"
- - "Scheduler_example06_IDLE"
- - "Scheduler_example08_LTS"
- - "Scheduler_example09_TimeCritical"
- - "Scheduler_example10_Benchmark"
- - "Scheduler_example11_Priority"
- - "Scheduler_example12_Priority"
- - "Scheduler_example13_Micros"
- - "Scheduler_example15_STDFunction"
- - "Scheduler_example16_Multitab"
- - "Scheduler_example17_Timeout"
- - "Scheduler_example18_StatusRequest_LTS_WDT_Timeout"
- - "Scheduler_example19_Dynamic_Tasks"
- - "Scheduler_example19_Dynamic_Tasks_SelfDestruct"
- - "Scheduler_example19_Dynamic_Tasks_stdQueue"
- - "Scheduler_example20_StatusRequest_LTS_WDT_Timeout_Object"
- - "Scheduler_example21_OO_Callbacks"
- - "Scheduler_example23_IDLE_Callback"
- - "Scheduler_example24_CPU_LOAD"
- - "Scheduler_example25_SCHEDULER_CHAIN"
- - "Scheduler_example26_SCHEDULING_OPTIONS"
- - "Scheduler_example28_Tickless"
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@main
- - name: Setup Arduino CLI
- uses: arduino/setup-arduino-cli@v1.1.1
- - name: Install platform
- run: |
- arduino-cli core update-index
- arduino-cli core install ${{ matrix.arduino-platform }}
- - name: Install repo as library
- run: |
- mkdir -p "$HOME/Arduino/libraries"
- ln -s "$PWD" "$HOME/Arduino/libraries/."
- - name: Install required libraries
- run: |
- mkdir -p "$HOME/Arduino/libraries"
- # Install QueueArray from Arduino Playground
- wget -O queuearray.zip https://playground.arduino.cc/uploads/Code/QueueArray/index.zip
- unzip queuearray.zip -d "$HOME/Arduino/libraries/"
- # Install MemoryFree library from Arduino Library Manager
- git clone https://github.com/McNeight/MemoryFree.git
- cp -r MemoryFree "$HOME/Arduino/libraries/"
-
- - name: Compile ${{ matrix.example }}
- run: arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/${{ matrix.example }} --warnings more
-
- ArduinoIDE_ESP8266_ONLY:
- strategy:
- matrix:
- arduino-platform: ["esp8266:esp8266"]
- fqbn: ["esp8266:esp8266:nodemcuv2"]
- example:
- - "Scheduler_example14_Yield"
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@main
- - name: Setup Arduino CLI
- uses: arduino/setup-arduino-cli@v1.1.1
- - name: Install platform
- run: |
- arduino-cli core update-index --additional-urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
- arduino-cli core install ${{ matrix.arduino-platform }} --additional-urls https://arduino.esp8266.com/stable/package_esp8266com_index.json
- - name: Install repo as library
- run: |
- mkdir -p "$HOME/Arduino/libraries"
- ln -s "$PWD" "$HOME/Arduino/libraries/."
- - name: Compile ${{ matrix.example }}
- run: arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/${{ matrix.example }} --warnings more
-
- ArduinoIDE_STM32:
- strategy:
- matrix:
- arduino-platform: ["STMicroelectronics:stm32"]
- fqbn: ["STMicroelectronics:stm32:Nucleo_64:pnum=NUCLEO_F401RE"]
- example:
- - "Scheduler_example00_Blink"
- - "Scheduler_example00_Blink_Namespace"
- - "Scheduler_example01"
- - "Scheduler_example02"
- - "Scheduler_example03"
- - "Scheduler_example04_StatusRequest"
- - "Scheduler_example05_StatusRequest"
- - "Scheduler_example06_IDLE"
- - "Scheduler_example08_LTS"
- - "Scheduler_example09_TimeCritical"
- - "Scheduler_example10_Benchmark"
- - "Scheduler_example11_Priority"
- - "Scheduler_example12_Priority"
- - "Scheduler_example13_Micros"
- - "Scheduler_example15_STDFunction"
- - "Scheduler_example16_Multitab"
- - "Scheduler_example17_Timeout"
- - "Scheduler_example18_StatusRequest_LTS_WDT_Timeout"
- - "Scheduler_example19_Dynamic_Tasks"
- - "Scheduler_example19_Dynamic_Tasks_SelfDestruct"
- - "Scheduler_example19_Dynamic_Tasks_stdQueue"
- - "Scheduler_example20_StatusRequest_LTS_WDT_Timeout_Object"
- - "Scheduler_example21_OO_Callbacks"
- - "Scheduler_example23_IDLE_Callback"
- - "Scheduler_example24_CPU_LOAD"
- - "Scheduler_example25_SCHEDULER_CHAIN"
- - "Scheduler_example26_SCHEDULING_OPTIONS"
- - "Scheduler_example28_Tickless"
- runs-on: ubuntu-latest
-
- steps:
- - name: Checkout
- uses: actions/checkout@main
-
- - name: Setup Arduino CLI
- uses: arduino/setup-arduino-cli@v1.1.1
-
- - name: Install platform
- run: |
- arduino-cli core update-index --additional-urls https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
- arduino-cli core install ${{ matrix.arduino-platform }} --additional-urls https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
-
- - name: Install repo as library
- run: |
- mkdir -p "$HOME/Arduino/libraries"
- ln -s "$PWD" "$HOME/Arduino/libraries/."
-
- - name: Install required libraries
- run: |
- mkdir -p "$HOME/Arduino/libraries"
- # Install QueueArray from Arduino Playground
- wget -O queuearray.zip https://playground.arduino.cc/uploads/Code/QueueArray/index.zip
- unzip queuearray.zip -d "$HOME/Arduino/libraries/"
- # Install MemoryFree library from GitHub
- git clone https://github.com/McNeight/MemoryFree.git
- cp -r MemoryFree "$HOME/Arduino/libraries/"
-
- - name: Compile ${{ matrix.example }}
- run: arduino-cli compile --fqbn ${{ matrix.fqbn }} ./examples/${{ matrix.example }} --warnings more
- PIO:
- strategy:
- matrix:
- example:
- - "Scheduler_example27_PlatformIO"
- - "Scheduler_example29_NonArduino"
- - "Scheduler_example30_THREAD_SAFE"
- environment:
- - "esp32dev"
- include:
- - example: "Scheduler_example27_PlatformIO"
- environment: "esp32dev"
- - example: "Scheduler_example29_NonArduino"
- environment: "esp32dev"
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@main
- - name: Set up Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.x'
- - name: Install PlatformIO
- run: |
- python -m pip install --upgrade pip
- pip install platformio
-
- - name: Setup libraries for PlatformIO
- run: |
- cd examples/${{ matrix.example }}
- # Remove any existing lib_deps from platformio.ini that reference TaskScheduler
- sed -i '/arkhipenko\/TaskScheduler/d' platformio.ini || true
- sed -i '/TaskScheduler/d' platformio.ini || true
- # Clone the current branch/commit to get TaskScheduler source
- mkdir -p lib
- git clone --depth 1 --branch ${GITHUB_REF#refs/heads/} https://github.com/${GITHUB_REPOSITORY}.git lib/TaskScheduler
- # Install other required libraries
- wget -O queuearray.zip https://playground.arduino.cc/uploads/Code/QueueArray/index.zip
- unzip queuearray.zip -d lib/
- git clone https://github.com/McNeight/MemoryFree.git
- cp -r MemoryFree lib/
- # Verify library installation
- ls -la lib/
-
- - name: Compile ${{ matrix.example }}
- run: |
- cd examples/${{ matrix.example }}
- pio run -e ${{ matrix.environment }}
|