Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Windows build job to Azure CI #397

Merged
merged 1 commit into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,17 @@ stages:
steps:
- template: unix-build.yml

- job: windows
pool:
vmImage: windows-latest
strategy:
matrix:
python37:
PYTHON_VERSION: 3.7
timeoutInMinutes: 20
steps:
- template: windows-build.yml

- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
- job: pr
displayName: ready to merge
Expand Down
6 changes: 3 additions & 3 deletions .azure-pipelines/unix-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ steps:
workingDirectory: $(Pipeline.Workspace)

# Download additional source repositories required by cctbx-base (but not dxtbx)
# cf. https://github.com/conda-forge/cctbx-base-feedstock/issues/12
- bash: |
set -eux
git clone https://github.com/dials/annlib.git modules/annlib
Expand All @@ -36,7 +37,7 @@ steps:

# Create a new conda environment using the bootstrap script
# Extract the dials-data version so we can correctly cache regression data.
- script: |
- bash: |
set -eux
python3 modules/dxtbx/.azure-pipelines/bootstrap.py base --clean --python $(PYTHON_VERSION)

Expand All @@ -46,8 +47,7 @@ steps:

dials.data info -v
echo "##vso[task.setvariable variable=DIALS_DATA_VERSION_FULL]$(dials.data info -v | grep version.full)"
echo "##vso[task.setvariable variable=DIALS_DATA_VERSION]$(dials.data info -v | grep version.major)"
# this is a bug in dials-data ^^^^^
echo "##vso[task.setvariable variable=DIALS_DATA_VERSION]$(dials.data info -v | grep version.major_minor)"
mkdir -p data
displayName: Create python $(PYTHON_VERSION) environment
workingDirectory: $(Pipeline.Workspace)
Expand Down
73 changes: 73 additions & 0 deletions .azure-pipelines/windows-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# This is work in progress.
# Currently the windows build only proceeds up to the base installation stage.

# Variables:
# CACHE_VERSION: unique cache identifier
# CURRENT_WEEK: weekly changing cache identifier
# PYTHON_VERSION: string in the form of "3.x"
# TODAY_ISO: today's date in ISO format, eg. "20200531"

steps:

# Obtain a shallow clone of the DXTBX repository.
# DXTBX will not be able to report proper version numbers
- checkout: self
path: ./modules/dxtbx
fetchDepth: 1
displayName: Checkout $(Build.SourceBranch)

# Download other source repositories
- bash: |
set -eux

# Extract the version of cctbx-base from the conda environment file
[[ "$(cat modules/dxtbx/.azure-pipelines/ci-conda-env.txt)" =~ cctbx-base==([^:space:]+) ]]
cctbx_version="$(echo "${BASH_REMATCH[1]}" | xargs)"
echo "Using cctbx conda release ${cctbx_version}"

python3 modules/dxtbx/.azure-pipelines/bootstrap.py update --branch cctbx_project@"v${cctbx_version}"
displayName: Repository checkout
workingDirectory: $(Pipeline.Workspace)

# Download additional source repositories required by cctbx-base (but not dxtbx)
# cf. https://github.com/conda-forge/cctbx-base-feedstock/issues/12
- bash: |
set -eux
git clone https://github.com/dials/annlib.git modules/annlib
git clone https://github.com/dials/annlib_adaptbx.git modules/annlib_adaptbx
displayName: Repository checkout (additional cctbx)
workingDirectory: $(Pipeline.Workspace)

# Create a new conda environment using the bootstrap script
- script: |
set PYTHONUNBUFFERED=TRUE
python3 modules/dxtbx/.azure-pipelines/bootstrap.py base --clean --python $(PYTHON_VERSION)
displayName: Create python $(PYTHON_VERSION) environment
workingDirectory: $(Pipeline.Workspace)

# Next steps are currently disabled due to
# https://github.com/conda-forge/cctbx-base-feedstock/issues/28
#
#
## Build dxtbx using the bootstrap script
#- script: |
# pushd "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
# for /f "delims=" %%x in ('.\vswhere.exe -latest -property InstallationPath') do set VSPATH=%%x
# popd
# call "%VSPATH%\VC\Auxiliary\Build\vcvarsall.bat" x64
#
# python3 modules/dxtbx/.azure-pipelines/bootstrap.py build
# displayName: dxtbx build
# workingDirectory: $(Pipeline.Workspace)
#
## Ensure we are using up-to-date testing packages.
## Extract the dials-data version so we can correctly cache regression data.
#- script: |
# call conda_base/Scripts/activate
# conda install -y dials-data pytest-azurepipelines pytest-timeout
# dials.data info -v
# echo "##vso[task.setvariable variable=DIALS_DATA_VERSION_FULL]$(dials.data info -v | grep version.full)"
# echo "##vso[task.setvariable variable=DIALS_DATA_VERSION]$(dials.data info -v | grep version.major_minor)"
# mkdir -p data
# displayName: Install additional packages
# workingDirectory: $(Pipeline.Workspace)
1 change: 1 addition & 0 deletions newsfragments/396.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add Windows build job to Azure CI that runs up to the 'base' installation stage.