name: TinyGo Build on: push: branches: [ "tinygo" ] pull_request: branches: [ "tinygo" ] workflow_dispatch: jobs: tinygo-build-all: permissions: contents: read runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - name: Set up Go uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 with: go-version: '1.24' - name: Install TinyGo run: | wget https://github.com/tinygo-org/tinygo/releases/download/v0.37.0/tinygo_0.37.0_amd64.deb sudo dpkg -i tinygo_0.37.0_amd64.deb - name: Build for all TinyGo targets id: build_step run: | make tinygo-build-all || true echo "Build process completed (some targets may have failed)" - name: Collect build results run: | mkdir -p artifacts unsupported_file="artifacts/unsupported-microcontrollers.txt" echo "# Unsupported Microcontrollers" > "$unsupported_file" echo "# Generated: $(date -u +"%Y-%m-%d %H:%M:%S UTC")" >> "$unsupported_file" echo "" >> "$unsupported_file" failed_count=0 for log_file in bin/build-*.log; do if [ -f "$log_file" ]; then target=$(basename "$log_file" | sed 's/build-\(.*\)\.log/\1/') binary_file="bin/reticulum-go-${target}" if [ ! -f "$binary_file" ] || grep -qi "error\|Error\|ERROR\|failed\|Failed\|FAILED" "$log_file"; then failed_count=$((failed_count + 1)) echo "## $target" >> "$unsupported_file" echo "" >> "$unsupported_file" if grep -qi "program too large\|overflowed\|too big\|LLVM ERROR\|Error while" "$log_file"; then grep -i "program too large\|overflowed\|too big\|LLVM ERROR\|Error while" "$log_file" | head -5 >> "$unsupported_file" else tail -15 "$log_file" >> "$unsupported_file" fi echo "" >> "$unsupported_file" echo "\`\`\`" >> "$unsupported_file" tail -30 "$log_file" >> "$unsupported_file" echo "\`\`\`" >> "$unsupported_file" echo "" >> "$unsupported_file" fi fi done echo "Total failed builds: $failed_count" >> "$unsupported_file" echo "Generated unsupported-microcontrollers.txt with $failed_count failed targets" - name: Upload build artifacts uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 with: name: tinygo-builds path: | bin/reticulum-go-* artifacts/unsupported-microcontrollers.txt if-no-files-found: warn