|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: [pull_request, push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + strategy: |
| 8 | + fail-fast: false |
| 9 | + matrix: |
| 10 | + arduino-platform: ['metro_m0'] |
| 11 | + |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Setup Python |
| 16 | + uses: actions/setup-python@v1 |
| 17 | + with: |
| 18 | + python-version: '3.x' |
| 19 | + |
| 20 | + - name: Checkout code |
| 21 | + uses: actions/checkout@v2 |
| 22 | + |
| 23 | + - name: Checkout submodules |
| 24 | + shell: bash |
| 25 | + run: | |
| 26 | + auth_header="$(git config --local --get http.https://github.com/.extraheader)" |
| 27 | + git submodule sync --recursive |
| 28 | + git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive |
| 29 | + |
| 30 | + - name: Install Arduino CLI and Tools |
| 31 | + run: | |
| 32 | + pip3 install adafruit-nrfutil |
| 33 | + # make all our directories we need for files and libraries |
| 34 | + mkdir $HOME/.arduino15 |
| 35 | + mkdir $HOME/.arduino15/packages |
| 36 | + mkdir $HOME/Arduino |
| 37 | + mkdir $HOME/Arduino/libraries |
| 38 | + curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh |
| 39 | + echo "::add-path::$GITHUB_WORKSPACE/bin" |
| 40 | + |
| 41 | + - name: Install BSP and Libraries |
| 42 | + env: |
| 43 | + BSP_URL: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json |
| 44 | + BSP_PATH: .arduino15/packages/adafruit/hardware/samd |
| 45 | + run: | |
| 46 | + arduino-cli config init |
| 47 | + arduino-cli core update-index |
| 48 | + arduino-cli core update-index --additional-urls $BSP_URL |
| 49 | + arduino-cli core install arduino:samd --additional-urls $BSP_URL |
| 50 | + arduino-cli core install adafruit:samd --additional-urls $BSP_URL |
| 51 | + # Repalce release BSP with our code |
| 52 | + BSP_VERSION=`eval ls $HOME/$BSP_PATH` |
| 53 | + rm -r $HOME/$BSP_PATH/* |
| 54 | + ln -s $GITHUB_WORKSPACE $HOME/$BSP_PATH/$BSP_VERSION |
| 55 | + arduino-cli lib install "FlashStorage" |
| 56 | +
|
| 57 | + - name: Build examples |
| 58 | + run: python3 tools/build_all.py ${{ matrix.arduino-platform }} |
0 commit comments