diff options
-rw-r--r-- | .gitlab-ci.yml | 70 | ||||
-rw-r--r-- | .gitlab-ci/test-msys2.sh | 55 |
2 files changed, 16 insertions, 109 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b7a16594..71917687 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -77,7 +77,8 @@ windows-gnu: - win - win2019 stage: build - # This job takes ~40 minutes to run, let's only execute it manually or for + image: registry.gitlab.com/sequoia-pgp/build-docker-image/windows-gnu + # This job takes ~20 minutes to run, let's only execute it manually or for # scheduled builds, otherwise this will stall MRs often not related to Windows only: - /windows/i # refs containing 'windows' keyword @@ -85,69 +86,30 @@ windows-gnu: - 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.46.0 --default-host x86_64-pc-windows-gnu --profile minimal - - $env:Path += ";$env:ProgramFiles\cargo\bin" - - rustup --version - - rustc --version --verbose - # Install chocolatey - - Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) - # 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" + - clang -v + - rustc --version --verbose + - cargo --version + script: + - cargo test --all --exclude sequoia-openpgp-ffi + # https://github.com/rust-lang/cargo/issues/5015 + - cargo test --manifest-path openpgp/Cargo.toml --no-default-features --features crypto-cng,compression after_script: [] + variables: + CFLAGS: '' # Silence some C warnings when compiling under Windows windows-msvc: tags: - win - win2019 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: - - /windows/i # refs containing 'windows' keyword - - tags - - web - - scheduled + image: registry.gitlab.com/sequoia-pgp/build-docker-image/windows-msvc before_script: - - $env:USERNAME - - $env:USERPROFILE - # Install VS 2019 VC++ Build Tools (Required for Rust on Windows) - - Get-Date - - Invoke-WebRequest https://aka.ms/vs/16/release/vs_buildtools.exe -OutFile vs_buildtools.exe - # Wait until the VC++ Build Tools installation is completed. - # See https://github.com/MicrosoftDocs/visualstudio-docs/issues/970 - - > - $exitCode = Start-Process - -FilePath vs_buildtools.exe - -ArgumentList "--norestart", "--quiet", "--nocache", "--add", "Microsoft.VisualStudio.Workload.VCTools", "--includeRecommended", "--wait" - -Wait - -PassThru - # Install Rust 1.40 - - Get-Date - - $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.46.0 --default-host x86_64-pc-windows-msvc --profile minimal - - $env:Path += ";$env:ProgramFiles\cargo\bin" - - Get-Date - - rustup --version - - rustc --version --verbose + - rustc --version --verbose + - cargo --version script: - - cd openpgp + - cargo check --all --exclude sequoia-openpgp-ffi # https://github.com/rust-lang/cargo/issues/5015 - - cargo test --no-default-features --features compression,crypto-cng + - cargo test --manifest-path openpgp/Cargo.toml --no-default-features --features crypto-cng,compression after_script: [] variables: CFLAGS: '' # Silence some C warnings when compiling with MSVC diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2.sh deleted file mode 100644 index e4d4fc16..00000000 --- a/.gitlab-ci/test-msys2.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -set -e - -# TODO: Currently, the CI times out at 1hr when downloading mingw-w64 packages -# (mainly Clang and LLVM). Until that's resolved, just test the -# `sequoia_openpgp` crate using the CNG backend - -# FIXME: Try to mitigate the download speed by sorting the mirrors by fastest -cat /etc/pacman.d/mirrorlist.msys -cat /etc/pacman.d/mirrorlist.mingw64 - -cp /etc/pacman.d/mirrorlist.msys /etc/pacman.d/mirrorlist.msys.backup -rankmirrors /etc/pacman.d/mirrorlist.msys.backup > /etc/pacman.d/mirrorlist.msys - -cp /etc/pacman.d/mirrorlist.mingw64 /etc/pacman.d/mirrorlist.mingw64.backup -rankmirrors /etc/pacman.d/mirrorlist.mingw64.backup > /etc/pacman.d/mirrorlist.mingw64 - -cat /etc/pacman.d/mirrorlist.msys -cat /etc/pacman.d/mirrorlist.mingw64 - -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 -gcc --version - -date -cd openpgp -# https://github.com/rust-lang/cargo/issues/5015 -cargo test --no-default-features --features crypto-cng,compression - -# # Ensure everything compiles but leave FFI tests for now -# cargo check --all --all-targets -# 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 -# # -p sequoia-ffi \ -# # -p sequoia-openpgp-ffi \ |