ci: separate meson tests and reorganize build steps

Instead of running the test directly in the build script, we can make a
separate step in the workflow so it looks a little prettier. For running
the actual tests, we skip mingw since they will never be run (cross
compiled). Additionally, improve the github workflow logic a bit so that
way logs on failure are only shown when that specific step fails. The
freebsd job still has to be less elegant since it's in a weird vm
thingy.

Not really related but the location of various build directories
(particularly waf) are corrected as well (might as well).
This commit is contained in:
Dudemanguy 2023-02-26 13:05:49 -06:00
parent 9db818279a
commit e82d9045a4
6 changed files with 62 additions and 25 deletions

View File

@ -37,26 +37,28 @@ jobs:
TARGET: ${{ matrix.target }}
- name: Build with meson
id: build
run: |
./ci/build-mingw64.sh meson pack
env:
TARGET: ${{ matrix.target }}
- name: Print meson log
if: ${{ failure() }}
if: steps.build.outcome == 'failure'
run: |
cat ./build/meson-logs/meson-log.txt
- name: Build with waf
id: build_waf
run: |
./ci/build-mingw64.sh waf
env:
TARGET: ${{ matrix.target }}
- name: Print waf log
if: ${{ failure() }}
if: steps.build_waf.outcome == 'failure'
run: |
cat ./build/config.log
cat ./build_waf/config.log
- uses: actions/upload-artifact@v3
with:
@ -86,6 +88,7 @@ jobs:
brew install autoconf automake pkg-config libtool python freetype fribidi little-cms2 lua@5.1 libass ffmpeg meson
- name: Build with meson
id: build
run: |
./ci/build-macos.sh meson
env:
@ -93,11 +96,22 @@ jobs:
TRAVIS_OS_NAME: "${{ matrix.os }}"
- name: Print meson log
if: ${{ failure() }}
if: steps.build.outcome == 'failure'
run: |
cat ./build/meson-logs/meson-log.txt
- name: Run meson tests
id: tests
run: |
meson test -C build
- name: Print meson test log
if: steps.tests.outcome == 'failure'
run: |
cat ./build/meson-logs/testlog.txt
- name: Build with waf
id: build_waf
run: |
./ci/build-macos.sh waf
env:
@ -105,9 +119,9 @@ jobs:
TRAVIS_OS_NAME: "${{ matrix.os }}"
- name: Print waf log
if: ${{ failure() }}
if: steps.build_waf.outcome == 'failure'
run: |
cat ./build/config.log
cat ./build_waf/config.log
linux:
runs-on: "ubuntu-22.04"
@ -130,22 +144,34 @@ jobs:
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Build with meson
id: build
run: |
./ci/build-tumbleweed.sh meson
- name: Print meson log
if: ${{ failure() }}
if: steps.build.outcome == 'failure'
run: |
cat ./build/meson-logs/meson-log.txt
- name: Run meson tests
id: tests
run: |
meson test -C build
- name: Print meson test log
if: steps.tests.outcome == 'failure'
run: |
cat ./build/meson-logs/testlog.txt
- name: Build with waf
id: build_waf
run: |
./ci/build-tumbleweed.sh waf
- name: Print waf log
if: ${{ failure() }}
if: steps.build_waf.outcome == 'failure'
run: |
cat ./build/config.log
cat ./build_waf/config.log
freebsd:
runs-on: macos-12 # until https://github.com/actions/runner/issues/385
@ -195,16 +221,22 @@ jobs:
#
run: |
./ci/build-freebsd.sh
meson test -C build
- name: Print meson log
if: ${{ failure() }}
run: |
cat ./build/meson-logs/meson-log.txt
- name: Print meson test log
if: ${{ failure() }}
run: |
cat ./build/meson-logs/testlog.txt
- name: Print waf log
if: ${{ failure() }}
run: |
cat ./build/config.log
cat ./build_waf/config.log
msys2:
runs-on: windows-latest
@ -253,19 +285,31 @@ jobs:
vulkan:p
- name: Build with meson
id: build
run: |
./ci/build-msys2.sh meson
- name: Print meson log
if: ${{ failure() }}
if: steps.build.outcome == 'failure'
run: |
cat ./build_meson/meson-logs/meson-log.txt
cat ./build/meson-logs/meson-log.txt
- name: Run meson tests
id: tests
run: |
meson test -C build
- name: Print meson test log
if: steps.tests.outcome == 'failure'
run: |
cat ./build/meson-logs/testlog.txt
- name: Build with waf
id: build_waf
run: |
./ci/build-msys2.sh waf
- name: Print waf log
if: ${{ failure() }}
if: steps.build_waf.outcome == 'failure'
run: |
cat ./build/config.log
cat ./build_waf/config.log

View File

@ -12,6 +12,7 @@ meson setup build \
-Dopenal=enabled \
-Dsdl2=enabled \
-Dsndio=enabled \
-Dtests=true \
-Dvdpau=enabled \
-Dvulkan=enabled \
-Doss-audio=enabled \
@ -22,7 +23,6 @@ meson setup build \
$NULL
meson compile -C build
meson test -C build
./build/mpv -v --no-config
if [ ! -e "./waf" ] ; then

View File

@ -14,13 +14,11 @@ if [[ $1 = "meson" ]]; then
PKG_CONFIG_PATH="${FFMPEG_SYSROOT}/lib/pkgconfig/" CC="${CC}" CXX="${CXX}" \
meson setup build \
-Dprefix="${MPV_INSTALL_PREFIX}" \
-Dlibmpv=true \
-D{libmpv,tests}=true \
-D{gl,iconv,lcms2,lua,jpeg,plain-gl,zlib}=enabled \
-D{cocoa,coreaudio,gl-cocoa,macos-cocoa-cb,macos-touchbar,videotoolbox-gl}=enabled
meson compile -C build -j4
meson test -C build
meson install -C build
./build/mpv -v --no-config
fi

View File

@ -200,16 +200,15 @@ rm -rf build
if [ "$1" = "meson" ]; then
meson setup build --cross-file "$prefix_dir/crossfile" \
--buildtype debugoptimized \
-D{libmpv,tests}=true -Dlua=luajit \
-Dlibmpv=true -Dlua=luajit \
-D{shaderc,spirv-cross,d3d11,libplacebo}=enabled
meson compile -C build
meson test -C build
elif [ "$1" = "waf" ]; then
PKG_CONFIG=pkg-config ./waf configure \
--out=build_waf \
--enable-libmpv-shared --lua=luajit \
--enable-{shaderc,spirv-cross,d3d11,libplacebo,tests}
--enable-{shaderc,spirv-cross,d3d11,libplacebo}
./waf build
fi

View File

@ -24,7 +24,6 @@ if [ "$1" = "meson" ]; then
-D vulkan=enabled
meson compile -C build
cp ./build/generated/mpv.com ./build
meson test -C build
./build/mpv.com -v --no-config
fi
@ -47,7 +46,6 @@ if [ "$1" = "waf" ]; then
--enable-rubberband \
--enable-shaderc \
--enable-spirv-cross \
--enable-tests \
--enable-uchardet \
--enable-vapoursynth \
--lua=luajit \

View File

@ -14,7 +14,6 @@ if [ "$1" = "meson" ]; then
-Dtests=true \
-Dvulkan=enabled
meson compile -C build
meson test -C build
./build/mpv -v --no-config
fi
@ -29,7 +28,6 @@ if [ "$1" = "waf" ]; then
--enable-manpage-build \
--enable-pipewire \
--enable-shaderc \
--enable-tests \
--enable-vulkan
python3 ./waf build
./build_waf/mpv -v --no-config