From 072f2cdafdd2bb7ed2d630d09c2a5697a4aec53d Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Mon, 10 Jan 2022 12:45:52 +0200 Subject: Add Github Actions CI build testing --- .github/workflows/ci.yml | 174 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 .github/workflows/ci.yml (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5508ba8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,174 @@ +name: CI +on: [push, pull_request] + +jobs: + linux-autotools: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build + run: | + ./autogen.sh + ./configure --enable-example + make -j$(nproc) CFLAGS="-g -O2 -Werror" CXXFLAGS="-g -O2 -Werror" + + linux-cmake: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build + run: | + cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" + cmake --build build + + macos-autotools: + runs-on: macos-latest + steps: + - name: Install autotools + run: | + brew install automake + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build + run: | + ./autogen.sh + ./configure --enable-example + make -j$(nproc) CFLAGS="-g -O2 -Werror" CXXFLAGS="-g -O2 -Werror" + + macos-cmake: + runs-on: macos-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build + run: | + cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" + cmake --build build + + mingw-cross-autotools: + runs-on: ubuntu-latest + steps: + - name: Install cross compiler + run: | + sudo apt-get install g++-mingw-w64-x86-64 + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build + run: | + ./autogen.sh + ./configure --enable-example --host=x86_64-w64-mingw32 + make -j$(nproc) CFLAGS="-g -O2 -Werror" CXXFLAGS="-g -O2 -Werror" + + mingw-cross-cmake: + runs-on: ubuntu-latest + steps: + - name: Install cross compiler + run: | + sudo apt-get install g++-mingw-w64-x86-64 + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build + run: | + cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_CROSSCOMPILING=TRUE -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" + cmake --build build + + msys-cmake: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: msys2/setup-msys2@v2 + with: + msystem: mingw64 + update: true + install: >- + git + mingw-w64-x86_64-toolchain + mingw-w64-x86_64-cmake + mingw-w64-x86_64-ninja + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build + run: | + cmake . -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES + cmake --build build + + msvc-cmake: + runs-on: windows-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build + run: | + cmake . -B build -DBUILD_PROGRAMS=YES + cmake --build build --config Release + + msvc-cmake-ninja-arm: + runs-on: windows-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Set up the environment + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: amd64_arm + - name: Build + run: | + cmake . -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES + cmake --build build + + msvc-cmake-arm64: + runs-on: windows-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build + run: | + cmake . -B build -DBUILD_PROGRAMS=YES -A ARM64 + cmake --build build --config Release + + llvm-mingw: + runs-on: ubuntu-latest + steps: + - name: Install llvm-mingw + run: | + wget https://github.com/mstorsjo/llvm-mingw/releases/download/20211002/llvm-mingw-20211002-ucrt-ubuntu-18.04-x86_64.tar.xz + tar -Jxvf llvm-mingw-20211002-ucrt-ubuntu-18.04-x86_64.tar.xz + rm llvm-mingw-*.tar.xz + sudo mv llvm-mingw-* /opt/llvm-mingw + echo /opt/llvm-mingw/bin >> $GITHUB_PATH + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build fdk-aac + run: | + ./autogen.sh + ./configure --host=aarch64-w64-mingw32 --enable-example + make -j$(nproc) CFLAGS="-g -O2 -Werror" CXXFLAGS="-g -O2 -Werror" + + linux-ffmpeg: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build fdk-aac + run: | + ./autogen.sh + mkdir build + cd build + ../configure --enable-example --prefix=$(pwd)/../prefix + make -j$(nproc) + make -j$(nproc) install + - name: Checkout FFmpeg + uses: actions/checkout@v2 + with: + repository: ffmpeg/ffmpeg + path: ffmpeg + - name: Build FFmpeg + run: | + sudo apt-get install -y nasm + cd ffmpeg + PKG_CONFIG_PATH=$(pwd)/../prefix/lib/pkgconfig ./configure --enable-libfdk-aac --enable-nonfree + make -j$(nproc) -- cgit v1.2.3 From 3f864cce9736cc8e9312835465fae18428d76295 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Tue, 31 May 2022 10:40:28 +0300 Subject: ci: Use sysctl instead of nproc on macOS There's no nproc command on macOS. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5508ba8..213ea6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: run: | ./autogen.sh ./configure --enable-example - make -j$(nproc) CFLAGS="-g -O2 -Werror" CXXFLAGS="-g -O2 -Werror" + make -j$(sysctl -n hw.ncpu) CFLAGS="-g -O2 -Werror" CXXFLAGS="-g -O2 -Werror" macos-cmake: runs-on: macos-latest -- cgit v1.2.3 From daaebe6a03c95d1afdbb9ba665ad6406e6e0f32d Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 6 Oct 2023 12:03:33 +0300 Subject: ci: Update the checkout steps to the latest, non deprecated version --- .github/workflows/ci.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 213ea6a..7f145db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build run: | ./autogen.sh @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build run: | cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" @@ -30,7 +30,7 @@ jobs: run: | brew install automake - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build run: | ./autogen.sh @@ -41,7 +41,7 @@ jobs: runs-on: macos-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build run: | cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" @@ -54,7 +54,7 @@ jobs: run: | sudo apt-get install g++-mingw-w64-x86-64 - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build run: | ./autogen.sh @@ -68,7 +68,7 @@ jobs: run: | sudo apt-get install g++-mingw-w64-x86-64 - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build run: | cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_CROSSCOMPILING=TRUE -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" @@ -90,7 +90,7 @@ jobs: mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build run: | cmake . -G Ninja -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES @@ -100,7 +100,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build run: | cmake . -B build -DBUILD_PROGRAMS=YES @@ -110,7 +110,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up the environment uses: ilammy/msvc-dev-cmd@v1 with: @@ -124,7 +124,7 @@ jobs: runs-on: windows-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build run: | cmake . -B build -DBUILD_PROGRAMS=YES -A ARM64 @@ -141,7 +141,7 @@ jobs: sudo mv llvm-mingw-* /opt/llvm-mingw echo /opt/llvm-mingw/bin >> $GITHUB_PATH - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build fdk-aac run: | ./autogen.sh @@ -152,7 +152,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Build fdk-aac run: | ./autogen.sh @@ -162,7 +162,7 @@ jobs: make -j$(nproc) make -j$(nproc) install - name: Checkout FFmpeg - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: repository: ffmpeg/ffmpeg path: ffmpeg -- cgit v1.2.3 From fc773cca673965b1fbc69a121cdce1566af9749c Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 6 Oct 2023 12:13:55 +0300 Subject: ci: Update the llvm-mingw job to the latest version --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f145db..c7134ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -135,8 +135,8 @@ jobs: steps: - name: Install llvm-mingw run: | - wget https://github.com/mstorsjo/llvm-mingw/releases/download/20211002/llvm-mingw-20211002-ucrt-ubuntu-18.04-x86_64.tar.xz - tar -Jxvf llvm-mingw-20211002-ucrt-ubuntu-18.04-x86_64.tar.xz + wget https://github.com/mstorsjo/llvm-mingw/releases/download/20231003/llvm-mingw-20231003-ucrt-ubuntu-20.04-x86_64.tar.xz + tar -Jxvf llvm-mingw-*-ucrt-ubuntu-*-x86_64.tar.xz rm llvm-mingw-*.tar.xz sudo mv llvm-mingw-* /opt/llvm-mingw echo /opt/llvm-mingw/bin >> $GITHUB_PATH -- cgit v1.2.3 From 23b030f80e99459166bdc22282c2c96f4f384368 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 6 Oct 2023 12:29:42 +0300 Subject: ci: Disable warnings about deprecated functions on macOS macOS has marked the function vsprintf deprecated; this is used in FDKsprintf with a number of uses in the codebase, that aren't entirely trivial to move over to vsnprintf. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7134ae..9c406fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ jobs: run: | ./autogen.sh ./configure --enable-example - make -j$(sysctl -n hw.ncpu) CFLAGS="-g -O2 -Werror" CXXFLAGS="-g -O2 -Werror" + make -j$(sysctl -n hw.ncpu) CFLAGS="-g -O2 -Werror" CXXFLAGS="-g -O2 -Werror -Wno-deprecated-declarations" macos-cmake: runs-on: macos-latest @@ -44,7 +44,7 @@ jobs: uses: actions/checkout@v4 - name: Build run: | - cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" + cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations" cmake --build build mingw-cross-autotools: -- cgit v1.2.3 From 48255d057aa61fde685b20492850043e37d8cb34 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 6 Oct 2023 12:44:05 +0300 Subject: github: Add -Wno-stringop-overflow to the GCC/CMake builds CMake builds with -O3 by default, while autotools builds with -O2. When optimizing in -O3 mode, GCC finds things to warn about with -Wno-stringop-overflow that it doesn't find in -O2 mode. (This happens at least with GCC 11, found in Ubuntu 22.04.) --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c406fc..baf261a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v4 - name: Build run: | - cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" + cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror -Wno-stringop-overflow" cmake --build build macos-autotools: @@ -71,7 +71,7 @@ jobs: uses: actions/checkout@v4 - name: Build run: | - cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_CROSSCOMPILING=TRUE -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror" + cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_CROSSCOMPILING=TRUE -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror -Wno-stringop-overflow" cmake --build build msys-cmake: -- cgit v1.2.3 From 0bfca3e06a098811a4cb71f285aa4e14e8f81372 Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Fri, 6 Oct 2023 15:01:53 +0300 Subject: ci: Run tests, add sanitizer build configurations that run tests too --- .github/workflows/ci.yml | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index baf261a..8dcc4e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,10 @@ jobs: ./autogen.sh ./configure --enable-example make -j$(nproc) CFLAGS="-g -O2 -Werror" CXXFLAGS="-g -O2 -Werror" + - name: Run tests + run: | + sudo apt-get install --no-install-recommends ffmpeg + ./test/run-test.sh linux-cmake: runs-on: ubuntu-latest @@ -22,6 +26,43 @@ jobs: run: | cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror -Wno-stringop-overflow" cmake --build build + - name: Run tests + run: | + sudo apt-get install --no-install-recommends ffmpeg + cd build + ../test/run-test.sh + + linux-sanitizers-gcc-autotools: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Build + run: | + ./autogen.sh + FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -fno-sanitize=shift-base -DDEBUG -fno-sanitize-recover=all" + CC="gcc $FLAGS" CXX="g++ $FLAGS" ./configure --enable-example + make -j$(nproc) + - name: Run tests + run: | + sudo apt-get install --no-install-recommends ffmpeg + ./test/run-test.sh + + linux-sanitizers-clang-cmake: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + - name: Build + run: | + FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -fno-sanitize=shift-base -DDEBUG -fno-sanitize-recover=all -fno-sanitize=vptr -fno-sanitize=function" + cmake . -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_PROGRAMS=YES -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_FLAGS="$FLAGS" -DCMAKE_CXX_FLAGS="$FLAGS" + cmake --build build + - name: Run tests + run: | + sudo apt-get install --no-install-recommends ffmpeg + cd build + ../test/run-test.sh macos-autotools: runs-on: macos-latest -- cgit v1.2.3 From 4753071b9c9cb18663c5711e1031fd7c71cff5ec Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Thu, 21 Dec 2023 12:49:04 +0200 Subject: ci: Do "apt-get update" before installing anything The existing package listings may be stale and pointing at files that no longer are present. --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to '.github/workflows') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dcc4e4..c6ba3ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: make -j$(nproc) CFLAGS="-g -O2 -Werror" CXXFLAGS="-g -O2 -Werror" - name: Run tests run: | - sudo apt-get install --no-install-recommends ffmpeg + sudo apt-get update && sudo apt-get install --no-install-recommends ffmpeg ./test/run-test.sh linux-cmake: @@ -28,7 +28,7 @@ jobs: cmake --build build - name: Run tests run: | - sudo apt-get install --no-install-recommends ffmpeg + sudo apt-get update && sudo apt-get install --no-install-recommends ffmpeg cd build ../test/run-test.sh @@ -45,7 +45,7 @@ jobs: make -j$(nproc) - name: Run tests run: | - sudo apt-get install --no-install-recommends ffmpeg + sudo apt-get update && sudo apt-get install --no-install-recommends ffmpeg ./test/run-test.sh linux-sanitizers-clang-cmake: @@ -60,7 +60,7 @@ jobs: cmake --build build - name: Run tests run: | - sudo apt-get install --no-install-recommends ffmpeg + sudo apt-get update && sudo apt-get install --no-install-recommends ffmpeg cd build ../test/run-test.sh @@ -93,7 +93,7 @@ jobs: steps: - name: Install cross compiler run: | - sudo apt-get install g++-mingw-w64-x86-64 + sudo apt-get update && sudo apt-get install g++-mingw-w64-x86-64 - name: Checkout sources uses: actions/checkout@v4 - name: Build @@ -107,7 +107,7 @@ jobs: steps: - name: Install cross compiler run: | - sudo apt-get install g++-mingw-w64-x86-64 + sudo apt-get update && sudo apt-get install g++-mingw-w64-x86-64 - name: Checkout sources uses: actions/checkout@v4 - name: Build @@ -209,7 +209,7 @@ jobs: path: ffmpeg - name: Build FFmpeg run: | - sudo apt-get install -y nasm + sudo apt-get update && sudo apt-get install -y nasm cd ffmpeg PKG_CONFIG_PATH=$(pwd)/../prefix/lib/pkgconfig ./configure --enable-libfdk-aac --enable-nonfree make -j$(nproc) -- cgit v1.2.3