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