From 235b9496ed3fa55366905ed8dd3f99fa206f8d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Thu, 13 May 2021 11:35:47 -0300 Subject: [PATCH 1/5] try fetch depth param --- azure-pipelines/run-unit-tests.yml | 1 + azure-pipelines/templates/default.yml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/azure-pipelines/run-unit-tests.yml b/azure-pipelines/run-unit-tests.yml index f5b84575f60..54a2162ffb2 100644 --- a/azure-pipelines/run-unit-tests.yml +++ b/azure-pipelines/run-unit-tests.yml @@ -33,6 +33,7 @@ jobs: steps: - template: templates/default.yml parameters: + fetchDepth: 1 fetchRefdata: true useMamba: true diff --git a/azure-pipelines/templates/default.yml b/azure-pipelines/templates/default.yml index 32e2f0ec9f7..481f8335763 100644 --- a/azure-pipelines/templates/default.yml +++ b/azure-pipelines/templates/default.yml @@ -2,6 +2,10 @@ # http://tardis-sn.github.io/tardis/development/continuous_integration.html parameters: + - name: fetchDepth + type: number + default: 0 + - name: fetchRefdata type: boolean default: false @@ -36,6 +40,7 @@ steps: - checkout: self path: s/tardis + fetchDepth: ${{ parameters.fetchDepth }} displayName: 'Fetch main repository' - ${{ if eq(parameters.fetchRefdata, true) }}: From 0e629c2b101bcaa2853a93a70b0024ae506bce7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Thu, 13 May 2021 12:20:55 -0300 Subject: [PATCH 2/5] update docs --- docs/development/continuous_integration.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/development/continuous_integration.rst b/docs/development/continuous_integration.rst index 0b4cf3f8d46..d64e49c4114 100644 --- a/docs/development/continuous_integration.rst +++ b/docs/development/continuous_integration.rst @@ -233,16 +233,17 @@ to start a new pipeline use:: steps: - template: templates/default.yml parameters: - fetchRefdata: true + useMamba: true **List of template parameters:** -- ``fetchRefdata``: fetch the ``tardis-refdata`` repository from Azure Repos - (default is *false*). -- ``useMamba``: use the ``mamba`` package manager instead of ``conda`` - (default is *false*). -- ``skipInstall``: does not create the TARDIS environment - (default is *false*). +- ``fetchDepth`` (*int*): the depth of commits to fetch from ``tardis`` repository, + default is ``0`` (no limit). +- ``fetchRefdata`` (*bool*): fetch the ``tardis-refdata`` repository from Azure Repos, + default is ``false``. +- ``useMamba`` (*bool*): use the ``mamba`` package manager instead of ``conda``, + default is ``false``. +- ``skipInstall`` (*bool*): does not create the TARDIS environment, default is ``false``. **List of predefined custom variables:** From 10427a4208c4b3efd9d6e19d1e741a746250b7da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Thu, 13 May 2021 12:43:30 -0300 Subject: [PATCH 3/5] try python setup.py install --- azure-pipelines/templates/default.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/templates/default.yml b/azure-pipelines/templates/default.yml index 481f8335763..1c0510763b3 100644 --- a/azure-pipelines/templates/default.yml +++ b/azure-pipelines/templates/default.yml @@ -69,5 +69,5 @@ steps: - bash: | cd $(tardis.dir) source activate tardis - python setup.py build_ext --inplace + python setup.py install displayName: 'Build C extensions' From f995d0ed00d1f594902ef533a12d829453197b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Thu, 13 May 2021 12:49:19 -0300 Subject: [PATCH 4/5] minor changes --- azure-pipelines/templates/default.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/azure-pipelines/templates/default.yml b/azure-pipelines/templates/default.yml index 1c0510763b3..d30060dceee 100644 --- a/azure-pipelines/templates/default.yml +++ b/azure-pipelines/templates/default.yml @@ -20,18 +20,18 @@ parameters: steps: - bash: echo "##vso[task.setvariable variable=shellopts]errexit" - displayName: 'Set BASH exit on error' + displayName: 'Force BASH exit on error' condition: eq(variables['Agent.OS'], 'Linux') - bash: | echo "##vso[task.setvariable variable=tardis.dir]$(Build.SourcesDirectory)/tardis" echo "##vso[task.setvariable variable=refdata.dir]$(Build.SourcesDirectory)/tardis-refdata" - displayName: 'Set source directories' + displayName: 'Set environment variables' - ${{ if eq(parameters.useMamba, false) }}: - bash: | echo "##vso[task.setvariable variable=package.manager]conda" - displayName: 'Set package manager' + displayName: 'Set environment variables' - ${{ if eq(parameters.useMamba, true) }}: - bash: | @@ -41,12 +41,11 @@ steps: - checkout: self path: s/tardis fetchDepth: ${{ parameters.fetchDepth }} - displayName: 'Fetch main repository' - ${{ if eq(parameters.fetchRefdata, true) }}: - checkout: git://TARDIS/tardis-refdata lfs: true - displayName: 'Fetch reference data repository' + displayName: 'Fetch reference data' - bash: echo "##vso[task.prependpath]$CONDA/bin" displayName: 'Add conda to PATH' @@ -57,17 +56,17 @@ steps: - ${{ if eq(parameters.useMamba, true) }}: - bash: conda install mamba -c conda-forge -y - displayName: 'Install package manager' + displayName: 'Install Mamba' - ${{ if eq(parameters.skipInstall, false) }}: - bash: | cd $(tardis.dir) $(package.manager) env create -f tardis_env3.yml - displayName: 'Install conda environment' + displayName: 'Setup environment' - ${{ if eq(parameters.skipInstall, false) }}: - bash: | cd $(tardis.dir) source activate tardis python setup.py install - displayName: 'Build C extensions' + displayName: 'Install package' From 59fcbac3a8eec6f93e69fa93bde9508667d36494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ezequiel=20P=C3=A1ssaro?= Date: Thu, 13 May 2021 12:51:11 -0300 Subject: [PATCH 5/5] minor changes --- azure-pipelines/run-unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines/run-unit-tests.yml b/azure-pipelines/run-unit-tests.yml index 54a2162ffb2..bb3c20c5acc 100644 --- a/azure-pipelines/run-unit-tests.yml +++ b/azure-pipelines/run-unit-tests.yml @@ -42,7 +42,7 @@ jobs: source activate tardis pip install pytest-azurepipelines pytest tardis --tardis-refdata=$(refdata.dir) --cov=tardis --cov-report=xml --cov-report=html - displayName: 'TARDIS test' + displayName: 'Run tests' - bash: bash <(curl -s https://codecov.io/bash) displayName: 'Upload to codecov.io'