tests Windows #315
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'tests Windows' | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
schedule: | |
- cron: "0 0 * * 6" # Run every Saturday at midnight | |
jobs: | |
mingw: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
build_type: [static, shared] | |
include: | |
- player: disabled | |
build_type: static | |
- player: enabled | |
build_type: shared | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 # Start a 64 bit Mingw environment | |
update: true | |
- name: Install dependencies | |
run: | | |
pacman -S --noconfirm --needed git | |
pacman -S --noconfirm --needed mingw-w64-x86_64-{toolchain,ffmpeg} | |
pacman -S --noconfirm mingw-w64-x86_64-python3-pip | |
pacman -S --noconfirm --needed mingw-w64-x86_64-meson | |
- name: Setup | |
run: | | |
meson setup builddir --default-library ${{ matrix.build_type }} -Dplayer=${{ matrix.player }} | |
- name: Build | |
run: | | |
meson compile -C builddir | |
- name: Test | |
run: | | |
meson test -C builddir | |
- name: Upload Logs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mingw-${{ matrix.build_type }}-logs | |
path: builddir/meson-logs | |
msvc: | |
runs-on: windows-latest | |
env: | |
FFMPEG_SRC: ffmpeg-n7.0-21-gfb8f0ea7b3-win64-gpl-shared-7.0 | |
FFMPEG_URL: https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2024-04-30-12-51 | |
PKGCONF_SRC: pkgconf-1.9.4 | |
PKGCONF_URL: https://distfiles.dereferenced.org/pkgconf | |
strategy: | |
matrix: | |
build_type: [static, shared] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
architecture: 'x64' | |
- name: Install meson | |
shell: bash | |
run: | | |
pip install meson | |
- name: Download pkgconf | |
shell: bash | |
run: | | |
curl -L -o ${{ env.PKGCONF_SRC }}.tar.xz ${{ env.PKGCONF_URL }}/${{ env.PKGCONF_SRC }}.tar.xz | |
tar xf ${{ env.PKGCONF_SRC }}.tar.xz | |
- name: Install pkgconf | |
shell: pwsh | |
run: | | |
.\scripts\msvc-env.ps1 | |
cd ${{ env.PKGCONF_SRC }} | |
meson setup builddir --buildtype release -Dtests=disabled --prefix "D:\a\nope.media\nope.media\pkgconf" | |
meson install -C builddir | |
copy D:\a\nope.media\nope.media\pkgconf\bin\pkgconf.exe D:\a\nope.media\nope.media\pkgconf\bin\pkg-config.exe | |
- name: Install dependencies | |
shell: bash | |
run: | | |
curl -L -o ${{ env.FFMPEG_SRC }}.zip ${{ env.FFMPEG_URL }}/${{ env.FFMPEG_SRC }}.zip | |
unzip ${{ env.FFMPEG_SRC }}.zip | |
ln -s ${{ env.FFMPEG_SRC }} ffmpeg | |
- name: Setup | |
shell: pwsh | |
run: | | |
.\scripts\msvc-env.ps1 | |
$env:Path = "D:\a\nope.media\nope.media\pkgconf\bin;" + $env:Path | |
meson setup builddir --backend vs --buildtype release --default-library ${{ matrix.build_type }} ` | |
--pkg-config-path "D:\a\nope.media\nope.media\ffmpeg\lib\pkgconfig" | |
- name: Build | |
shell: pwsh | |
run: | | |
.\scripts\msvc-env.ps1 | |
meson compile -C builddir | |
- name: Test | |
shell: pwsh | |
run: | | |
.\scripts\msvc-env.ps1 | |
$env:Path = "D:\a\nope.media\nope.media\ffmpeg\bin;" + $env:Path | |
meson test -C builddir | |
- name: Upload Logs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: msvc-${{ matrix.build_type }}-logs | |
path: builddir/meson-logs |