diff --git a/.github/workflows/tinygo.yml b/.github/workflows/tinygo.yml index 3fe0c87..0e21510 100644 --- a/.github/workflows/tinygo.yml +++ b/.github/workflows/tinygo.yml @@ -5,29 +5,15 @@ on: branches: [ "tinygo" ] pull_request: branches: [ "tinygo" ] + workflow_dispatch: jobs: - tinygo-build: + tinygo-build-all: permissions: contents: read - strategy: - matrix: - include: - - name: tinygo-default - target: "" - output: reticulum-go-tinygo - make_target: tinygo-build - - name: tinygo-wasm - target: wasm - output: reticulum-go.wasm - make_target: tinygo-wasm - runs-on: ubuntu-latest - outputs: - build_complete: ${{ steps.build_step.outcome == 'success' }} - steps: - name: Checkout code uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -42,23 +28,54 @@ jobs: 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 with TinyGo + - name: Build for all TinyGo targets id: build_step run: | - make ${{ matrix.make_target }} - output_name="${{ matrix.output }}" - if [ -f "bin/${output_name}" ]; then - sha256sum "bin/${output_name}" | cut -d' ' -f1 > "bin/${output_name}.sha256" - echo "Built: ${output_name}" - echo "Generated checksum: bin/${output_name}.sha256" - else - echo "Build output not found: bin/${output_name}" - ls -la bin/ - exit 1 - fi + make tinygo-build-all || true + echo "Build process completed (some targets may have failed)" - - name: Upload Artifact + - 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: ${{ matrix.name }} - path: bin/${{ matrix.output }}* + name: tinygo-builds + path: | + bin/reticulum-go-* + artifacts/unsupported-microcontrollers.txt + if-no-files-found: warn