Merge pull request #65 from TexasInstruments/am62p-fix-lpm #202
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: [ "master", "dev"] | |
pull_request: | |
branches: [ "master" ] | |
workflow_dispatch: | |
jobs: | |
# Job1: Prepare list of configrations for Job2 | |
prepare-build: | |
runs-on: ubuntu-latest | |
outputs: | |
builds: ${{ steps.prepare-builds.outputs.builds }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Generate builds list | |
id: prepare-builds | |
run: | | |
pip3 install toml-cli | |
builds=($(toml get builds --toml-path ./builds.toml | tr -d "[],'")) | |
output_string="[" | |
for build in ${builds[@]} | |
do | |
output_string="${output_string}""\"${build}\"," | |
done | |
output_string="${output_string::-1}""]" | |
echo "builds=${output_string}" >> $GITHUB_OUTPUT | |
# Job2: Actual build job | |
build: | |
runs-on: ubuntu-latest | |
needs: prepare-build | |
strategy: | |
matrix: | |
builds: ${{ fromJson(needs.prepare-build.outputs.builds) }} | |
name: ${{ matrix.builds }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt upgrade | |
sudo apt install -y \ | |
pigz expect pv \ | |
binfmtc binfmt-support \ | |
qemu-user qemu-user-static qemu-system-arm \ | |
debian-archive-keyring bdebstrap \ | |
build-essential autoconf automake \ | |
bison flex libssl-dev \ | |
bc u-boot-tools swig python3-pyelftools \ | |
gcc-aarch64-linux-gnu \ | |
gpg curl | |
sudo apt install --fix-broken | |
sudo pip3 install toml-cli | |
sudo pip3 install yamllint | |
curl -s --compressed https://texasinstruments.github.io/ti-debpkgs/KEY.gpg | \ | |
gpg --dearmor | \ | |
sudo tee /usr/share/keyrings/ti-debpkgs.gpg > /dev/null | |
- name: Build ${{ matrix.builds }} | |
run: | | |
mkdir -p build | |
sudo ./build.sh ${{ matrix.builds }} | |
distro_codename=($(toml get ${{ matrix.builds }}.distro_codename --toml-path ./builds.toml)) | |
bsp_version=($(toml get ${distro_codename}.bsp_version --toml-path ./configs/bsp_sources.toml)) | |
builds_out="${{ matrix.builds }}-${bsp_version}" | |
echo "builds_out=${builds_out}" >>$GITHUB_ENV | |
- name: Upload ${{ env.builds_out }} | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
path: build/${{ env.builds_out }}.tar.xz | |
name: ${{ env.builds_out }} | |
if-no-files-found: error | |
- name: Upload ${{ matrix.builds }}.log | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
path: logs/${{ matrix.builds }}.log | |
name: ${{ matrix.builds }}.log | |
if-no-files-found: error |