platformio.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. name: platformio
  2. on:
  3. push:
  4. pull_request:
  5. jobs:
  6. platformio:
  7. name: Build and run PlatformIO example
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: ⤵️ Check out code from GitHub
  11. uses: actions/checkout@v2
  12. with:
  13. path: nanopb
  14. - name: Installing dependencies for local act
  15. if: ${{ env.ACT }}
  16. run: |
  17. sudo apt update
  18. - name: Installing common dependencies
  19. run: |
  20. sudo apt install -y python3-pip
  21. - name: Install and setup PlatformIO
  22. run: |
  23. pip3 install -U platformio
  24. export PATH=~/.local/bin:$PATH
  25. - name: Build PlatformIO package
  26. run: |
  27. cd nanopb
  28. pio package pack
  29. - name: Example - Extract PlatformIO package to example dir
  30. run: |
  31. cp -R nanopb/examples/platformio example
  32. mkdir -p example/lib/nanopb
  33. tar -xzf nanopb/Nanopb-*.tar.gz -C example/lib/nanopb
  34. - name: Example - Build
  35. run: |
  36. cd example
  37. pio run
  38. - name: Example - Run test without options
  39. run: example/.pio/build/pio_without_options/program
  40. - name: Example - Run test with options
  41. run: example/.pio/build/pio_with_options/program
  42. - name: Build with default platformio.ini
  43. run: |
  44. mkdir -p test_default_pio_conf
  45. cd test_default_pio_conf
  46. pio project init
  47. ln -s ../nanopb lib/nanopb
  48. echo "[env:native]" >> platformio.ini
  49. echo "platform = native" >> platformio.ini
  50. echo "lib_deps = Nanopb" >> platformio.ini
  51. echo "int main(int argc, char *argv[]){}" > src/main.cpp
  52. pio run