You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
3.4 KiB

  1. name: Build Examples
  2. # Triggers the workflow on push or pull request events
  3. on: [push, pull_request]
  4. jobs:
  5. build:
  6. runs-on: ubuntu-latest
  7. if: "!contains(github.event.head_commit.message, 'ci skip')"
  8. strategy:
  9. matrix:
  10. example:
  11. [
  12. examples/BlynkClient,
  13. examples/FileDownload,
  14. examples/MqttClient,
  15. examples/WebClient,
  16. tools/AT_Debug,
  17. tools/Diagnostics,
  18. tools/FactoryReset,
  19. ]
  20. modem:
  21. [
  22. TINY_GSM_MODEM_A6,
  23. TINY_GSM_MODEM_BG96,
  24. TINY_GSM_MODEM_ESP8266,
  25. TINY_GSM_MODEM_M95,
  26. TINY_GSM_MODEM_M590,
  27. TINY_GSM_MODEM_MC60,
  28. TINY_GSM_MODEM_SIM800,
  29. TINY_GSM_MODEM_SIM808,
  30. TINY_GSM_MODEM_SIM5360,
  31. TINY_GSM_MODEM_SIM7600,
  32. TINY_GSM_MODEM_SIM7000,
  33. TINY_GSM_MODEM_UBLOX,
  34. TINY_GSM_MODEM_SARAR4,
  35. TINY_GSM_MODEM_XBEE,
  36. TINY_GSM_MODEM_SEQUANS_MONARCH,
  37. ]
  38. steps:
  39. - uses: actions/checkout@v2
  40. - name: Set variables
  41. run: |
  42. if [[ -z "${GITHUB_HEAD_REF}" ]]; then
  43. echo "::debug::Push to commit ${GITHUB_SHA}"
  44. echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_SHA}" >> $GITHUB_ENV
  45. else
  46. echo "::debug::Pull Request from the ${GITHUB_HEAD_REF} branch"
  47. echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_HEAD_REF}" >> $GITHUB_ENV
  48. fi
  49. - name: Restore or Cache pip
  50. uses: actions/cache@v2.1.4
  51. with:
  52. path: ~/.cache/pip
  53. # if requirements.txt hasn't changed, then it will be a "cache hit" and pip will be restored
  54. # if requirements.txt HAS changed, it will be a "cache miss" and a new cache of pip will be created if the job completes successfully
  55. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
  56. restore-keys: ${{ runner.os }}-pip-
  57. - name: Restore or Cache PlatformIO and Libraries
  58. uses: actions/cache@v2.1.4
  59. with:
  60. path: ~/.platformio
  61. # if nothing in the lock files has changed, then it will be a "cache hit" and pip will be restored
  62. # otherwise, it will be a "cache miss" and a new cache of libraries will be created if the job completes successfully
  63. key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
  64. - name: Set up Python
  65. uses: actions/setup-python@v2
  66. # This should be pulled from cache, if there's not a new version
  67. - name: Install PlatformIO
  68. run: |
  69. python -m pip install --upgrade pip
  70. pip install --upgrade platformio
  71. - name: Run PlatformIO
  72. env:
  73. PLATFORMIO_CI_SRC: ${{ matrix.example }}
  74. TINYGSM_MODEM_TO_USE: ${{ matrix.modem }}
  75. run: |
  76. echo "${{ env.LIBRARY_INSTALL_SOURCE }}"
  77. pio lib --global install ${{ env.LIBRARY_INSTALL_SOURCE }}
  78. pio lib --global install 89 415 1202 1286
  79. platformio ci --project-option='build_flags=-D ${{ env.TINYGSM_MODEM_TO_USE }}' --project-option='framework=arduino' --board=uno --board=leonardo --board=yun --board=megaatmega2560 --board=genuino101 --board=mkr1000USB --board=zero --board=teensy31 --board=bluepill_f103c8 --board=uno_pic32 --board=esp01 --board=nodemcuv2 --board=esp32dev
  80. pio lib --global uninstall TinyGSM