Skip to content

add Dockerfile, enable PR build, and improve documentation #67

add Dockerfile, enable PR build, and improve documentation

add Dockerfile, enable PR build, and improve documentation #67

Workflow file for this run

name: prudynt-t
on:
workflow_dispatch:
pull_request:
branches:
- '**'
env:
TAG_NAME: release
TOOLCHAIN_URL: https://github.com/themactep/thingino-firmware/releases/download/toolchain-x86_64/thingino-toolchain-x86_64_xburst1_4_4_musl_gcc14-linux-mipsel.tar.gz
TOOLCHAIN_DIR: /opt/mipsel-thingino-linux-musl_sdk-buildroot
CCACHE_DIR: ${{ github.workspace }}/.ccache
jobs:
native-build:
name: prudynt-build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- T10
- T20
- T21
- T23
- T30
- T31
- C100
build_type:
- static
- dynamic
- hybrid
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends --no-install-suggests \
build-essential bc bison cpio curl file flex git libncurses-dev \
make rsync unzip wget whiptail gcc lzop u-boot-tools \
ca-certificates cmake ccache
- name: Download and extract toolchain
run: |
mkdir -p /opt
cd /opt
wget "$TOOLCHAIN_URL" -O thingino-toolchain.tar.gz
tar -xf thingino-toolchain.tar.gz
cd mipsel-thingino-linux-musl_sdk-buildroot
./relocate-sdk.sh
- name: Set up toolchain and ccache env vars
run: |
echo "TOOLCHAIN_DIR=${TOOLCHAIN_DIR}" >> $GITHUB_ENV
echo "PATH=${TOOLCHAIN_DIR}/bin:/usr/lib/ccache:$PATH" >> $GITHUB_ENV
echo "CC=ccache ${TOOLCHAIN_DIR}/bin/mipsel-linux-gcc" >> $GITHUB_ENV
echo "CXX=ccache ${TOOLCHAIN_DIR}/bin/mipsel-linux-g++" >> $GITHUB_ENV
echo "PRUDYNT_CROSS=ccache ${TOOLCHAIN_DIR}/bin/mipsel-linux-" >> $GITHUB_ENV
- name: Restore ccache
id: restore-ccache
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/.ccache
key: ccache-${{ matrix.target }}-${{ matrix.build_type }}
- name: Set build suffix
id: suffix
run: |
case "${{ matrix.build_type }}" in
static) echo "SUFFIX=-static" >> $GITHUB_ENV ;;
hybrid) echo "SUFFIX=-hybrid" >> $GITHUB_ENV ;;
*) echo "SUFFIX=" >> $GITHUB_ENV ;;
esac
- name: Build deps
run: |
./build.sh deps ${{ matrix.target }} $SUFFIX
- name: Build prudynt
run: |
./build.sh prudynt ${{ matrix.target }} $SUFFIX
mv bin/prudynt "bin/prudynt-${{ matrix.target }}-${{ matrix.build_type }}"
- name: Save ccache
id: save-ccache
if: always()
uses: actions/cache/save@v4
with:
key: ${{ steps.restore-ccache.outputs.cache-primary-key }}
path: ${{ github.workspace }}/.ccache
- name: Upload binary as artifact
uses: actions/upload-artifact@v4
with:
name: prudynt-${{ matrix.target }}-${{ matrix.build_type }}
path: bin/prudynt-${{ matrix.target }}-${{ matrix.build_type }}
- name: Upload binary to release
if: github.event_name != 'pull_request'
uses: softprops/[email protected]
with:
tag_name: ${{ env.TAG_NAME }}
files: |
bin/prudynt-${{ matrix.target }}-${{ matrix.build_type }}