From fbd17c8954f5b9c057c31d23e72d6606fd04662e Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Thu, 1 Oct 2020 14:22:45 +0200 Subject: ci: Use our pre-built docker images for testing Windows These come with preinstalled with either Visual C++ Build Tools (MSVC) or other dependencies, e.g. clang or nettle (GNU). Installing these dependencies take significant amount of time so let's only do it once and only run relevant checks in the CI/CD pipeline. --- .gitlab-ci.yml | 70 ++++++++++++++-------------------------------------------- 1 file changed, 16 insertions(+), 54 deletions(-) (limited to '.gitlab-ci.yml') 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 -- cgit v1.2.3