Repository navigation
128 lines (119 loc) · 4.71 KB
/
Copy pathci.yaml
File metadata and controls
128 lines (119 loc) · 4.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: CI
on:
push:
branches: ['main']
pull_request:
workflow_dispatch:
# Least-privilege default: no job here needs to write anything.
permissions:
contents: read
# Cancel superseded runs on the same branch/PR to save CI minutes.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
# Test matrix: one job per pixi environment x (linux, windows). The
# suites are pytest marker selections (pyproject.toml) bound to pixi tasks
# (pixi.toml): `core` runs the engine-free suites in the default env with the
# core guard on (tests/conftest.py), `gsasii` and `easydiffraction` run their
# engine's suite in its env. Only `topas_exec` is absent: it needs tc.exe and
# stays a manual gate step on the TOPAS machine. Every job is gated to the
# upstream repository: CI runs with the PR to NSLS2/PowderLine, not on
# forks, and each job's command is proven locally first:
# pixi run test · pixi run -e gsasii test-gsasii · pixi run -e easydiffraction test-easydiffraction · pixi run docs
# setup-pixi caches .pixi/envs per lock-file hash and environment; the cache
# is written only on pushes to main so PRs read it and the gsasii env (the
# slow pixi-build one) is built once per lock change.
jobs:
core:
# The no-plugin guarantee: schema layer, registry, CLI, TOPAS input generation,
# without any engine installed or importable.
if: github.repository == 'NSLS2/PowderLine'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
with:
pixi-version: v0.83.0
environments: default
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Engine-free suites (core + topas_gen, core guard on)
run: pixi run test
- name: Generated field tables and support matrix are current
run: pixi run fields-check
- name: EB/KI catalogue fragments are current and every cited ID has an entry
run: pixi run catalog-check
- name: Example figures are current
run: pixi run figures-check
gsasii:
# GSAS-II suite incl. the slow regressions against the committed references.
if: github.repository == 'NSLS2/PowderLine'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
with:
pixi-version: v0.83.0
environments: gsasii
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: GSAS-II suite
run: pixi run -e gsasii test-gsasii
easydiffraction:
# easydiffraction suite (native runs and goldens; no GSAS-II in this env).
if: github.repository == 'NSLS2/PowderLine'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
with:
pixi-version: v0.83.0
environments: easydiffraction
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: easydiffraction suite
run: pixi run -e easydiffraction test-easydiffraction
docs:
# Build-only check that the docs still compile warning-free
# (`pixi run docs` uses `sphinx-build -W`, so any warning fails this
# job); the actual GitHub Pages deploy lives in docs.yml and only runs
# on pushes to main. For pull requests we intentionally only run this for
# external forks: same-repository PRs are not the normal contribution path
# and would otherwise duplicate CI for the upstream branch workflow.
if: >-
github.repository == 'NSLS2/PowderLine' &&
(github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: prefix-dev/setup-pixi@a0af7a228712d6121d37aba47adf55c1332c9c2e # v0.9.4
with:
pixi-version: v0.83.0
- name: Build docs
run: pixi run docs