circuitpython/.github/workflows/re-build-mpy-cross.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

71 lines
2.1 KiB
YAML
Raw Normal View History

2023-03-04 01:41:30 -05:00
name: Reusable | Build mpy-cross
2023-02-10 09:17:51 -05:00
on:
workflow_call:
inputs:
cp-version:
required: true
type: string
2023-02-15 10:55:56 -05:00
secrets:
AWS_ACCESS_KEY_ID:
required: false
AWS_SECRET_ACCESS_KEY:
required: false
2023-02-10 09:17:51 -05:00
jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
mpy-cross: ["static", "static-aarch64", "static-mingw", "static-raspbian"]
env:
CP_VERSION: ${{ inputs.cp-version }}
EX_static-mingw: static.exe
OS_static: linux-amd64
OS_static-aarch64: linux-aarch64
OS_static-mingw: windows
OS_static-raspbian: linux-raspbian
steps:
- name: Set up repository
uses: actions/checkout@v3
with:
submodules: false
fetch-depth: 1
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Set up submodules
2023-02-11 01:30:27 -05:00
uses: ./.github/actions/deps/submodules
2023-02-10 09:17:51 -05:00
with:
target: mpy-cross
- name: Install toolchain (aarch64)
if: matrix.mpy-cross == 'static-aarch64'
run: sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Install toolchain (mingw)
if: matrix.mpy-cross == 'static-mingw'
run: sudo apt-get install -y mingw-w64
- name: Build mpy-cross.${{ matrix.mpy-cross }}
run: make -C mpy-cross -j2 -f Makefile.${{ matrix.mpy-cross }}
2023-02-11 01:30:27 -05:00
- name: Set output
run: |
echo >> $GITHUB_ENV "EX=${{ env[format('EX_{0}', matrix.mpy-cross)] || matrix.mpy-cross }}"
echo >> $GITHUB_ENV "OS=${{ env[format('OS_{0}', matrix.mpy-cross)] }}"
2023-02-10 09:17:51 -05:00
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
2023-02-11 01:30:27 -05:00
name: mpy-cross.${{ env.EX }}
path: mpy-cross/mpy-cross.${{ env.EX }}
2023-02-10 09:17:51 -05:00
- name: Upload to S3
2023-02-10 12:33:13 -05:00
uses: ./.github/actions/upload_aws
with:
2023-02-11 01:30:27 -05:00
source: mpy-cross/mpy-cross.${{ env.EX }}
destination: mpy-cross/${{ env.OS }}/mpy-cross-${{ env.OS }}-${{ env.CP_VERSION }}.${{ env.EX }}
2023-02-10 09:17:51 -05:00
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}