2023-07-22 02:55:42 -04:00
|
|
|
#############################################################################
|
|
|
|
#
|
|
|
|
# Author: Jia Tan
|
|
|
|
#
|
|
|
|
# This file has been put into the public domain.
|
|
|
|
# You can do whatever you want with this file.
|
|
|
|
#
|
|
|
|
#############################################################################
|
|
|
|
|
|
|
|
name: Windows-CI
|
|
|
|
|
|
|
|
# Only run the Windows CI manually since it takes much longer than the others.
|
|
|
|
on: workflow_dispatch
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
POSIX:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
# Test different environments since the code may change between
|
|
|
|
# them and we want to ensure that we support all potential users.
|
2023-09-29 10:11:54 -04:00
|
|
|
# clang64 builds are currently broken when building static libraries
|
|
|
|
# due to a bug in ldd search path:
|
|
|
|
# https://github.com/llvm/llvm-project/issues/67779
|
|
|
|
# TODO - re-enable clang64 when this is resolved.
|
|
|
|
msys2_env: [mingw64, mingw32, ucrt64, msys]
|
2023-07-25 08:17:23 -04:00
|
|
|
build_system: [autotools, cmake]
|
2023-07-22 02:55:42 -04:00
|
|
|
|
|
|
|
# Set the shell to be msys2 as a default to avoid setting it for
|
|
|
|
# every individual run command.
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: msys2 {0}
|
|
|
|
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
#####################
|
|
|
|
# Setup Environment #
|
|
|
|
#####################
|
|
|
|
|
|
|
|
# Rely on the msys2 GitHub Action to set up the msys2 environment.
|
|
|
|
- name: Setup MSYS2
|
2023-09-26 11:55:13 -04:00
|
|
|
uses: msys2/setup-msys2@27b3aa77f672cb6b3054121cfd80c3d22ceebb1d #v2.20.1
|
2023-07-22 02:55:42 -04:00
|
|
|
with:
|
2023-07-25 08:14:53 -04:00
|
|
|
msystem: ${{ matrix.msys2_env }}
|
2023-07-22 02:55:42 -04:00
|
|
|
update: true
|
2023-07-28 09:56:48 -04:00
|
|
|
install: pactoys make
|
2023-07-22 02:55:42 -04:00
|
|
|
|
|
|
|
- name: Checkout code
|
|
|
|
# Need to explicitly set the shell here since we set the default
|
|
|
|
# shell as msys2 earlier. This avoids an extra msys2 dependency on
|
|
|
|
# git.
|
|
|
|
shell: powershell
|
|
|
|
# Avoid Windows line endings. Otherwise test_scripts.sh will fail
|
|
|
|
# because the expected output is stored in the test framework as a
|
|
|
|
# text file and will not match the output from xzgrep.
|
|
|
|
run: git config --global core.autocrlf false
|
|
|
|
|
2023-09-26 11:55:13 -04:00
|
|
|
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0
|
2023-07-22 02:55:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
########################
|
|
|
|
# Install Dependencies #
|
|
|
|
########################
|
|
|
|
|
|
|
|
# The pacman repository has a different naming scheme for default
|
|
|
|
# msys packages than the others. The pacboy tool allows installing
|
|
|
|
# the packages possible in matrix setup without a burdensome amount
|
|
|
|
# of ifs.
|
|
|
|
- name: Install Dependencies
|
2023-07-25 08:17:23 -04:00
|
|
|
if: ${{ matrix.msys2_env == 'msys' && matrix.build_system == 'autotools' }}
|
2023-07-22 02:55:42 -04:00
|
|
|
run: pacman --noconfirm -S --needed autotools base-devel doxygen gettext-devel gcc
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
2023-07-25 08:17:23 -04:00
|
|
|
if: ${{ matrix.msys2_env != 'msys' && matrix.build_system == 'autotools' }}
|
2023-07-28 09:56:48 -04:00
|
|
|
run: pacboy --noconfirm -S --needed autotools:p toolchain:p doxygen:p
|
2023-07-22 02:55:42 -04:00
|
|
|
|
2023-07-25 08:17:23 -04:00
|
|
|
- name: Install Dependencies
|
|
|
|
if: ${{ matrix.msys2_env == 'msys' && matrix.build_system == 'cmake' }}
|
|
|
|
run: pacman --noconfirm -S --needed cmake base-devel gcc
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
if: ${{ matrix.msys2_env != 'msys' && matrix.build_system == 'cmake' }}
|
2023-07-28 09:56:48 -04:00
|
|
|
run: pacboy --noconfirm -S --needed cmake:p toolchain:p
|
2023-07-22 02:55:42 -04:00
|
|
|
|
|
|
|
##################
|
|
|
|
# Build and Test #
|
|
|
|
##################
|
|
|
|
|
|
|
|
- name: Build with full features
|
2023-07-25 08:17:23 -04:00
|
|
|
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -p build
|
2023-07-22 02:55:42 -04:00
|
|
|
- name: Test with full features
|
2023-07-25 08:17:23 -04:00
|
|
|
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -p test -n full_features
|
2023-07-22 02:55:42 -04:00
|
|
|
|
|
|
|
- name: Build without threads
|
2023-07-25 08:17:23 -04:00
|
|
|
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p build
|
2023-07-22 02:55:42 -04:00
|
|
|
- name: Test without threads
|
2023-07-25 08:17:23 -04:00
|
|
|
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d threads,shared -p test -n no_threads
|
2023-07-22 02:55:42 -04:00
|
|
|
|
|
|
|
- name: Build without encoders
|
2023-07-25 08:17:23 -04:00
|
|
|
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p build
|
2023-07-22 02:55:42 -04:00
|
|
|
- name: Test without encoders
|
2023-07-25 08:17:23 -04:00
|
|
|
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d encoders,shared -p test -n no_encoders
|
2023-07-22 02:55:42 -04:00
|
|
|
|
|
|
|
- name: Build without decoders
|
2023-07-25 08:17:23 -04:00
|
|
|
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p build
|
2023-07-22 02:55:42 -04:00
|
|
|
- name: Test without decoders
|
2023-07-25 08:17:23 -04:00
|
|
|
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -d decoders,shared -p test -n no_decoders
|
2023-07-22 02:55:42 -04:00
|
|
|
|
|
|
|
- name: Build with only crc32 check
|
2023-07-25 08:17:23 -04:00
|
|
|
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p build
|
2023-07-22 02:55:42 -04:00
|
|
|
- name: Test with only crc32 check
|
2023-07-25 08:17:23 -04:00
|
|
|
run: ./build-aux/ci_build.sh -a "--no-po4a" -b ${{ matrix.build_system }} -c crc32 -d shared,nls -p test -n crc32_only
|
2023-07-22 02:55:42 -04:00
|
|
|
|
|
|
|
|
|
|
|
###############
|
|
|
|
# Upload Logs #
|
|
|
|
###############
|
|
|
|
|
|
|
|
# Upload the test logs as artifacts if any step has failed.
|
2023-09-26 11:55:13 -04:00
|
|
|
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 #v3.1.3
|
2023-07-22 02:55:42 -04:00
|
|
|
if: ${{ failure() }}
|
|
|
|
with:
|
2023-07-25 08:14:53 -04:00
|
|
|
name: ${{ matrix.msys2_env }} ${{ matrix.build_system }} Test Logs
|
2023-07-22 02:55:42 -04:00
|
|
|
path: build-aux/artifacts
|