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.

92 lines
3.6 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/test_build,
  17. tools/Diagnostics,
  18. ]
  19. modem:
  20. [
  21. TINY_GSM_MODEM_A6,
  22. TINY_GSM_MODEM_BG96,
  23. TINY_GSM_MODEM_ESP8266,
  24. TINY_GSM_MODEM_M95,
  25. TINY_GSM_MODEM_M590,
  26. TINY_GSM_MODEM_MC60,
  27. TINY_GSM_MODEM_SIM800,
  28. TINY_GSM_MODEM_SIM808,
  29. TINY_GSM_MODEM_SIM5360,
  30. TINY_GSM_MODEM_SIM7600,
  31. TINY_GSM_MODEM_SIM7000,
  32. TINY_GSM_MODEM_SIM7000SSL,
  33. TINY_GSM_MODEM_SIM7070,
  34. TINY_GSM_MODEM_UBLOX,
  35. TINY_GSM_MODEM_SARAR4,
  36. TINY_GSM_MODEM_XBEE,
  37. TINY_GSM_MODEM_SEQUANS_MONARCH,
  38. ]
  39. steps:
  40. - uses: actions/checkout@v2
  41. - name: Set variables
  42. run: |
  43. if [[ -z "${GITHUB_HEAD_REF}" ]]; then
  44. echo "::debug::Push to commit ${GITHUB_SHA}"
  45. echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_SHA}" >> $GITHUB_ENV
  46. else
  47. echo "::debug::Pull Request from the ${GITHUB_HEAD_REF} branch"
  48. echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_HEAD_REF}" >> $GITHUB_ENV
  49. fi
  50. - name: Restore or Cache pip
  51. uses: actions/cache@v2.1.4
  52. with:
  53. path: ~/.cache/pip
  54. # if requirements.txt hasn't changed, then it will be a "cache hit" and pip will be restored
  55. # 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
  56. key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
  57. restore-keys: ${{ runner.os }}-pip-
  58. - name: Restore or Cache PlatformIO and Libraries
  59. uses: actions/cache@v2.1.4
  60. with:
  61. path: ~/.platformio
  62. # if nothing in the lock files has changed, then it will be a "cache hit" and pip will be restored
  63. # otherwise, it will be a "cache miss" and a new cache of libraries will be created if the job completes successfully
  64. key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
  65. - name: Set up Python
  66. uses: actions/setup-python@v2
  67. # This should be pulled from cache, if there's not a new version
  68. - name: Install PlatformIO
  69. run: |
  70. python -m pip install --upgrade pip
  71. pip install --upgrade platformio
  72. - name: Run PlatformIO
  73. env:
  74. PLATFORMIO_CI_SRC: ${{ matrix.example }}
  75. TINYGSM_MODEM_TO_USE: ${{ matrix.modem }}
  76. run: |
  77. echo "${{ env.LIBRARY_INSTALL_SOURCE }}"
  78. pio lib --global install ${{ env.LIBRARY_INSTALL_SOURCE }}
  79. pio lib --global install 89 415 1202 1286
  80. sed -i 's/\/\/ #define TINY_GSM_MODEM_SIM800/#define TINY_GSM_MODEM_SIM800/g' ${{ matrix.example }}/*
  81. 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
  82. pio lib --global uninstall TinyGSM