|
| 1 | +name: Build boards |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + platform: |
| 7 | + required: true |
| 8 | + type: string |
| 9 | + |
| 10 | + boards: |
| 11 | + required: true |
| 12 | + type: string |
| 13 | + |
| 14 | + cp-version: |
| 15 | + required: true |
| 16 | + type: string |
| 17 | + |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + runs-on: ubuntu-22.04 |
| 21 | + env: |
| 22 | + CP_VERSION: ${{ inputs.cp-version }} |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + board: ${{ fromJSON(inputs.boards) }} |
| 27 | + steps: |
| 28 | + - name: Dump GitHub context |
| 29 | + run: echo "$GITHUB_CONTEXT" |
| 30 | + env: |
| 31 | + GITHUB_CONTEXT: ${{ toJson(github) }} |
| 32 | + - name: Set up repository |
| 33 | + uses: actions/checkout@v3 |
| 34 | + with: |
| 35 | + submodules: false |
| 36 | + fetch-depth: 1 |
| 37 | + - name: Set up python |
| 38 | + uses: actions/setup-python@v4 |
| 39 | + with: |
| 40 | + python-version: 3.x |
| 41 | + - name: Set up port |
| 42 | + uses: ./.github/actions/port_deps |
| 43 | + with: |
| 44 | + platform: ${{ inputs.platform }} |
| 45 | + - name: Set up submodules |
| 46 | + id: set-up-submodules |
| 47 | + uses: ./.github/actions/fetch_submodules |
| 48 | + - name: Set up external |
| 49 | + uses: ./.github/actions/external_deps |
| 50 | + with: |
| 51 | + platform: ${{ inputs.platform }} |
| 52 | + |
| 53 | + - name: Versions |
| 54 | + run: | |
| 55 | + gcc --version |
| 56 | + python3 --version |
| 57 | + cmake --version || true |
| 58 | + ninja --version || true |
| 59 | + aarch64-none-elf-gcc --version || true |
| 60 | + arm-none-eabi-gcc --version || true |
| 61 | + xtensa-esp32-elf-gcc --version || true |
| 62 | + riscv32-esp-elf-gcc --version || true |
| 63 | + riscv64-unknown-elf-gcc --version || true |
| 64 | + mkfs.fat --version || true |
| 65 | +
|
| 66 | + - name: Download mpy-cross |
| 67 | + if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }} |
| 68 | + uses: actions/download-artifact@v3 |
| 69 | + with: |
| 70 | + name: mpy-cross |
| 71 | + path: mpy-cross |
| 72 | + - name: Make mpy-cross executable |
| 73 | + if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }} |
| 74 | + run: sudo chmod +x mpy-cross/mpy-cross |
| 75 | + |
| 76 | + - name: Set up build failure matcher |
| 77 | + run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json" |
| 78 | + - name: Build |
| 79 | + run: python3 -u build_release_files.py |
| 80 | + working-directory: tools |
| 81 | + env: |
| 82 | + BOARDS: ${{ matrix.board }} |
| 83 | + |
| 84 | + - name: Upload artifact |
| 85 | + uses: actions/upload-artifact@v3 |
| 86 | + with: |
| 87 | + name: ${{ matrix.board }} |
| 88 | + path: bin/${{ matrix.board }} |
| 89 | + - name: Upload to S3 |
| 90 | + if: >- |
| 91 | + (github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit') || |
| 92 | + (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested')) |
| 93 | + run: | |
| 94 | + pip install awscli |
| 95 | + [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1 |
| 96 | + env: |
| 97 | + AWS_PAGER: '' |
| 98 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 99 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
0 commit comments