summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Matuszewski <igor@sequoia-pgp.org>2020-03-19 16:03:57 +0100
committerIgor Matuszewski <igor@sequoia-pgp.org>2020-03-30 11:48:47 +0200
commit79ea050a62e0281d19bfa8e643c6f870585f5cac (patch)
tree20e86f41905b941424152657c32713da7dd345de
parentb19d332f36db71177c8dfbe7821d4cc03586173a (diff)
ci: Add a Windows job using GitLab Windows Shared Runners
-rw-r--r--.gitattributes1
-rw-r--r--.gitlab-ci.yml38
-rw-r--r--.gitlab-ci/test-msys2.sh33
3 files changed, 72 insertions, 0 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 00000000..6313b56c
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto eol=lf
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7d02ff97..83b4dba9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,9 @@
+.shared_windows_runners:
+ tags:
+ - shared-windows
+ - windows
+ - windows-1809
+
before_script:
- if [ -d $CARGO_TARGET_DIR ]; then find $CARGO_TARGET_DIR | wc --lines; du -sh $CARGO_TARGET_DIR; fi
- if [ -d $CARGO_HOME ]; then find $CARGO_HOME | wc --lines; du -sh $CARGO_HOME; fi
@@ -65,6 +71,38 @@ rust-stable:
CARGO_TARGET_DIR: $CI_PROJECT_DIR/../target.$CI_CONCURRENT_ID.rust-stable
RUSTFLAGS: -D warnings -A unused-parens
+windows:
+ extends:
+ - .shared_windows_runners
+ stage: build
+ # This job takes ~40 minutes to run, let's only execute it manually or for
+ # scheduled builds, otherwise this will stall MRs often not related to Windows
+ only:
+ - tags
+ - web
+ - scheduled
+ before_script:
+ - $env:USERNAME
+ - $env:USERPROFILE
+ # Install Rust 1.40
+ - $env:CARGO_HOME = "$env:ProgramFiles\cargo"
+ - $env:RUSTUP_HOME = "$env:ProgramFiles\rustup"
+ - Invoke-WebRequest https://win.rustup.rs -OutFile rustup-init.exe
+ - .\rustup-init.exe -y --default-toolchain 1.40.0 --default-host x86_64-pc-windows-gnu --profile minimal
+ - $env:Path += ";$env:ProgramFiles\cargo\bin"
+ - rustup --version
+ - rustc --version --verbose
+ # Install MSYS2/mingw-w64
+ - choco install msys2 -y
+ - $env:Path += ";C:\tools\msys64"
+ - $env:MSYSTEM = "MINGW64"
+ - $env:MSYS = "winsymlinks:nativestrict"
+ - $env:MSYS2_PATH_TYPE = "inherit" # Inherit PATH from Windows
+ - $env:CHERE_INVOKING = "1" # Inherit working directory
+ - $env:CFLAGS = "" # Disregard C warnings due to MinGW being funky
+ script: C:/tools/msys64/usr/bin/bash.exe -l -c "bash -x ./.gitlab-ci/test-msys2.sh"
+ after_script: []
+
variables:
DEBIAN_FRONTEND: noninteractive
CARGO_HOME: $CI_PROJECT_DIR/../cargo
diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2.sh
new file mode 100644
index 00000000..a78232c6
--- /dev/null
+++ b/.gitlab-ci/test-msys2.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+set -e
+
+date
+pacman --noconfirm -S --needed \
+ base-devel \
+ mingw-w64-x86_64-toolchain \
+ mingw-w64-x86_64-bzip2 \
+ mingw-w64-x86_64-nettle \
+ mingw-w64-x86_64-sqlite3 \
+ mingw-w64-x86_64-capnproto \
+ mingw-w64-x86_64-clang
+# ^^ It's worth noting that for Rust < 1.40, bindgen has problem picking up
+# correct libclang. This is tested and working for clang 9 but if that
+# stops for any reason (newer versions), we'd need to download a specific
+# version from repo.msys2.org/mingw/x86_64/ and install it manually.
+
+clang --version
+
+date
+# Ensure everything compiles but leave FFI tests for now
+# Also omit some of the time-consuming tests because we hit CI 1hr timeout
+cargo test -v \
+ -p buffered-reader \
+ -p sequoia-ipc \
+ -p sequoia-openpgp \
+ -p sequoia-sqv
+# -p sequoia-autocrypt \
+# -p sequoia-core \
+# -p sequoia-net
+# -p sequoia-store # FIXME: Somehow keeps CI stalled (zombie children proc?)
+# -p sequoia-ffi \
+# -p sequoia-openpgp-ffi \