Skip to content

chore(deps): upgrade Go from 1.24.0 to 1.26.1 #35

chore(deps): upgrade Go from 1.24.0 to 1.26.1

chore(deps): upgrade Go from 1.24.0 to 1.26.1 #35

Workflow file for this run

name: Go tests
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
jobs:
build:
name: Build and test on ${{ matrix.os }} ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- os: linux
arch: amd64
runner: ubuntu-24.04
- os: linux
arch: arm64
runner: ubuntu-24.04-arm
- os: darwin
arch: amd64
runner: macos-15-intel
- os: darwin
arch: arm64
runner: macos-15
fail-fast: false
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Install libclang for generator
run: |
if [ "${{ matrix.os }}" = "linux" ]; then
sudo apt-get update
# Use libclang-18 which works with Newbluecake/bootstrap v0.17.1 (supports clang 17+)
sudo apt-get install -y libclang-18-dev llvm-18-dev
echo "CGO_LDFLAGS=-L/usr/lib/llvm-18/lib" >> $GITHUB_ENV
echo "CGO_CFLAGS=-I/usr/lib/llvm-18/include" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/lib/llvm-18/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
elif [ "${{ matrix.os }}" = "darwin" ]; then
# On macOS, use LLVM 18 to match Linux environment
brew install llvm@18 || brew install llvm
if [ -d "$(brew --prefix llvm@18)" ]; then
LLVM_PREFIX=$(brew --prefix llvm@18)
else
LLVM_PREFIX=$(brew --prefix llvm)
echo "::warning::Using latest LLVM on macOS instead of version 18"
fi
echo "CGO_LDFLAGS=-L${LLVM_PREFIX}/lib" >> $GITHUB_ENV
echo "CGO_CFLAGS=-I${LLVM_PREFIX}/include" >> $GITHUB_ENV
echo "PATH=${LLVM_PREFIX}/bin:$PATH" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=${LLVM_PREFIX}/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
fi
- name: Download FFmpeg libraries
run: go run ./cmd/download-lib/
- name: Build
run: go build -v .
# Note: macOS may show linker warnings about version mismatches if the static
# libraries were built on a newer macOS version than the runner.
# These warnings are harmless - the libraries have MACOSX_DEPLOYMENT_TARGET=13.0
- name: Test
run: go test -v .
# The generator creates Go bindings from FFmpeg headers using libclang.
# It's only needed during development when FFmpeg is updated.
# Using Newbluecake/bootstrap v0.17.1 which supports LLVM/Clang 17+
- name: Run generator (optional - for development only)
run: |
echo "::notice::Generator uses Newbluecake/bootstrap v0.17.1 which supports LLVM 17+"
echo "::notice::Using LLVM 18 in CI, compatible with the fork's clang 17 support"
echo "Running generator with environment:"
echo "CGO_LDFLAGS=$CGO_LDFLAGS"
echo "CGO_CFLAGS=$CGO_CFLAGS"
go run ./internal/generator 2>&1 | grep -v "cgo-gcc-prolog\|deprecated" || true
continue-on-error: true
- name: Check for generated code differences
run: |
if ! git diff --quiet *.gen.go; then
echo "::notice title=Generated Code Diff on ${{ matrix.os }}/${{ matrix.arch }}::Generated bindings differ from committed version. This may be platform-specific behavior."
git diff *.gen.go > /tmp/generator-diff.txt
echo "::group::Generator Diff"
cat /tmp/generator-diff.txt
echo "::endgroup::"
else
echo "::notice title=Generated Code Match on ${{ matrix.os }}/${{ matrix.arch }}::Generated bindings match committed version."
fi
continue-on-error: true