Skip to content

Commit

Permalink
Merge branch 'main' into general-timepix-format
Browse files Browse the repository at this point in the history
  • Loading branch information
ndevenish committed Aug 16, 2024
2 parents 6590d87 + 74fd1f1 commit 466004b
Show file tree
Hide file tree
Showing 419 changed files with 26,526 additions and 10,940 deletions.
74 changes: 4 additions & 70 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,16 @@
variables:
CACHE_VERSION: 20201102
ENABLE_CACHE: 0

schedules:
# nightly builds to populate caches
- cron: "3 0 * * Mon"
displayName: Weekly midnight build
branches:
include:
- master
- main
always: true
- cron: "3 0 * * Tue-Sat,Sun"
displayName: Daily midnight build
branches:
include:
- master

jobs:
- job: setup
displayName: syntax validation
pool:
vmImage: ubuntu-latest
steps:
- checkout: none

# Use Python >=3.7 for syntax validation
- task: UsePythonVersion@0
displayName: Set up python
inputs:
versionSpec: 3.7

# Run syntax validation on a shallow clone
- bash: |
mkdir repository
cd repository
echo Checking out $(Build.SourceBranch) from $(Build.Repository.Uri)
git init
git remote add origin $(Build.Repository.Uri)
git fetch --depth 1 --no-recurse-submodules origin $(Build.SourceBranch)
git checkout FETCH_HEAD
python .azure-pipelines/syntax-validation.py
displayName: Syntax validation
# Set up date constants for caching in further build jobs
- bash: |
echo "##vso[task.setvariable variable=CURRENT_WEEK;isOutput=true]$(date +W%W)"
echo "##vso[task.setvariable variable=TODAY_ISO;isOutput=true]$(date +%Y%m%d)"
displayName: Set up build constants
name: constants
- job: flake8
displayName: flake8 validation
dependsOn: setup
pool:
vmImage: ubuntu-latest
steps:
- checkout: none

# Use Python >=3.7 for flake8
- task: UsePythonVersion@0
displayName: Set up python
inputs:
versionSpec: 3.7

# Run flake8 validation on a shallow clone
- bash: |
pip install flake8 &
mkdir repository
cd repository
echo Checking out $(Build.SourceBranch) from $(Build.Repository.Uri)
git init
git remote add origin $(Build.Repository.Uri)
git fetch --depth 1 --no-recurse-submodules origin $(Build.SourceBranch)
git checkout FETCH_HEAD
wait
python .azure-pipelines/flake8-validation.py
displayName: Flake8 validation
- template: .azure-pipelines/azure-pipelines-linux.yml
- main

- template: .azure-pipelines/azure-pipelines-mac.yml
extends:
template: .azure-pipelines/azure-pipelines.yml
49 changes: 0 additions & 49 deletions .azure-pipelines/azure-pipelines-linux.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .azure-pipelines/azure-pipelines-mac.yml

This file was deleted.

135 changes: 135 additions & 0 deletions .azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
variables:
CACHE_VERSION: 20210424
isPullRequest: $[startsWith(variables['Build.SourceBranch'], 'refs/pull/')]

stages:
- stage: prepare
displayName: Check
jobs:
- job: setup
displayName: static analysis
pool:
vmImage: ubuntu-20.04
timeoutInMinutes: 10
steps:
- checkout: none

# Use Python >=3.9 for syntax validation
- task: UsePythonVersion@0
displayName: Set up python
inputs:
versionSpec: 3.9

# Run syntax validation on a shallow clone
- bash: |
set -eux
mkdir repository
cd repository
echo Checking out $(Build.SourceBranch) from $(Build.Repository.Uri)
git init
git remote add origin $(Build.Repository.Uri)
git fetch --depth 1 --no-recurse-submodules origin $(Build.SourceBranch)
git checkout FETCH_HEAD
python .azure-pipelines/syntax-validation.py
displayName: Syntax validation
- bash: |
set -eux
pip install ruff
cd repository
python .azure-pipelines/lint-validation.py
displayName: Ruff validation
# Set up constants for further build steps
- bash: |
echo "##vso[task.setvariable variable=CURRENT_WEEK;isOutput=true]$(date +W%W)"
echo "##vso[task.setvariable variable=TODAY_ISO;isOutput=true]$(date +%Y%m%d)"
echo
echo "Checking for waiting newsfragments:"
cd repository/newsfragments
\ls -1 --color=never | grep -v "^\([0-9]\+\|README\)\." && {
echo "##vso[task.setvariable variable=NEWSFRAGMENT_WAITING;isOutput=true]true"
} || {
echo "none found"
echo "##vso[task.setvariable variable=NEWSFRAGMENT_WAITING;isOutput=true]false"
}
displayName: Set up build constants
name: constants
- stage: build
${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')) }}:
displayName: Build
${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
displayName: PR
condition: and(eq(dependencies.prepare.outputs['setup.constants.NEWSFRAGMENT_WAITING'], 'false'),
succeeded())
dependsOn:
- prepare
variables:
CURRENT_WEEK: $[ stageDependencies.prepare.setup.outputs['constants.CURRENT_WEEK'] ]
TODAY_ISO: $[ stageDependencies.prepare.setup.outputs['constants.TODAY_ISO'] ]

jobs:
- ${{ if eq(variables['Build.Reason'], 'Schedule') }}:
# A single build job is sufficient to regenerate caches, no need to waste build time
- job: linux
displayName: linux python38 (scheduled)
pool:
vmImage: ubuntu-20.04
timeoutInMinutes: 60
variables:
PYTHON_VERSION: 3.9
steps:
- template: unix-build.yml

- ${{ if ne(variables['Build.Reason'], 'Schedule') }}:
- job: linux
pool:
vmImage: ubuntu-20.04
strategy:
matrix:
python39:
PYTHON_VERSION: 3.9
python312:
PYTHON_VERSION: 3.12
timeoutInMinutes: 60
steps:
- template: unix-build.yml

- job: macos
pool:
vmImage: macOS-latest
strategy:
matrix:
python39:
PYTHON_VERSION: 3.9
python312:
PYTHON_VERSION: 3.12
timeoutInMinutes: 60
steps:
- template: unix-build.yml

- job: windows
pool:
vmImage: windows-2019
strategy:
matrix:
python39:
PYTHON_VERSION: 3.9
python312:
PYTHON_VERSION: 3.12
timeoutInMinutes: 20
steps:
- template: windows-build.yml

- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}:
- job: pr
displayName: ready to merge
dependsOn:
- linux
- macos
condition: and(eq(variables.isPullRequest, true), succeeded())
pool:
vmImage: ubuntu-20.04
steps:
- checkout: none
Loading

0 comments on commit 466004b

Please sign in to comment.