Skip to content

Commit

Permalink
ci: add Windows Cygwin and msys2 builds to GitHub Actions
Browse files Browse the repository at this point in the history
AppVeyor will only run builds one at a time whereas GitHub Actions will
run all builds in parallel.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
  • Loading branch information
vincentkfu committed Apr 25, 2023
1 parent f28aff6 commit 98a18b6
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 6 deletions.
75 changes: 71 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
- macos
- linux-i686-gcc
- android
- windows-cygwin-64
- windows-cygwin-32
- windows-msys2-64
include:
- build: linux-gcc
os: ubuntu-22.04
Expand All @@ -31,20 +34,84 @@ jobs:
- build: android
os: ubuntu-22.04
arch: aarch64-linux-android32
- build: windows-cygwin-64
os: windows-latest
arch: x86_64
installer_arch: x64
shell: bash
- build: windows-cygwin-32
os: windows-latest
arch: i686
installer_arch: x86
shell: bash
- build: windows-msys2-64
os: windows-latest
cc: clang
arch: x86_64
installer_arch: x64
shell: msys2

env:
CI_TARGET_BUILD: ${{ matrix.build }}
CI_TARGET_ARCH: ${{ matrix.arch }}
CC: ${{ matrix.cc }}

steps:
- name: git config line endings (Windows)
if: ${{ contains( matrix.build, 'windows' ) }}
run: git config --global core.autocrlf input
- name: Checkout repo
uses: actions/checkout@v3
- name: Install Cygwin toolchain (Windows)
if: ${{ contains( matrix.build, 'windows' ) && !contains( matrix.build, 'msys2' ) }}
uses: cygwin/cygwin-install-action@master
with:
packages: >
mingw64-${{matrix.arch}}-binutils
mingw64-${{matrix.arch}}-CUnit
mingw64-${{matrix.arch}}-curl
mingw64-${{matrix.arch}}-dlfcn
mingw64-${{matrix.arch}}-gcc-core
mingw64-${{matrix.arch}}-headers
mingw64-${{matrix.arch}}-runtime
mingw64-${{matrix.arch}}-zlib
- name: Install msys2 toolchain (Windows)
if: ${{ contains( matrix.build, 'windows' ) && contains( matrix.build, 'msys2' ) }}
uses: msys2/setup-msys2@v2
with:
install: >
git
base-devel
mingw-w64-${{matrix.arch}}-clang
mingw-w64-${{matrix.arch}}-cunit
mingw-w64-${{matrix.arch}}-toolchain
mingw-w64-${{matrix.arch}}-lld
mingw-w64-${{matrix.arch}}-python-scipy
mingw-w64-${{matrix.arch}}-python-six
mingw-w64-${{matrix.arch}}-python-statsmodels
mingw-w64-${{matrix.arch}}-python-sphinx
- name: Install dependencies
run: ./ci/actions-install.sh
run: ${{matrix.shell}} ./ci/actions-install.sh
if: ${{ !contains( matrix.build, 'msys2' ) }}
- name: Build
run: ./ci/actions-build.sh
run: ${{matrix.shell}} ./ci/actions-build.sh
- name: Build installer (Windows)
if: ${{ contains( matrix.build, 'windows' ) }}
shell: cmd
run: |
cd os\windows
dobuild.cmd ${{ matrix.installer_arch }}
cd ..\..
- name: Upload installer (Windows)
if: ${{ contains( matrix.build, 'windows' ) }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.build }}-installer
path: os\windows\*.msi
- name: Smoke test
run: ./ci/actions-smoke-test.sh
run: ${{matrix.shell}} ./ci/actions-smoke-test.sh
- name: Full test
run: ./ci/actions-full-test.sh
run: ${{matrix.shell}} ./ci/actions-full-test.sh
12 changes: 11 additions & 1 deletion ci/actions-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,17 @@ main() {
)
;;
esac
;;
;;
*/windows)
configure_flags+=("--disable-native")
case "${CI_TARGET_ARCH}" in
"i686")
configure_flags+=("--build-32bit-win")
;;
"x86_64")
;;
esac
;;
esac
configure_flags+=(--extra-cflags="${extra_cflags}")

Expand Down
4 changes: 4 additions & 0 deletions ci/actions-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ install_macos() {
pip3 install scipy six statsmodels
}

install_windows() {
pip3 install scipy six statsmodels sphinx
}

main() {
if [ "${CI_TARGET_BUILD}" = "android" ]; then
echo "Installing Android NDK..."
Expand Down
2 changes: 1 addition & 1 deletion ci/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function set_ci_target_os {
darwin*)
CI_TARGET_OS="macos"
;;
msys*)
cygwin|msys*)
CI_TARGET_OS="windows"
;;
bsd*)
Expand Down

0 comments on commit 98a18b6

Please sign in to comment.