Repository navigation
119 lines (105 loc) · 3.93 KB
/
Copy pathcomp-test.yml
File metadata and controls
119 lines (105 loc) · 3.93 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
name: CALLED Compile binaries and then test them.
#
# Called from .github/workflows/comp_test_matrix.yml
#
# This uses scripts in .github/actions/meson-*/action.yml to actually
# run meson and create the binaries, which are uploaded as tar files.
permissions:
contents: write
on:
workflow_call:
inputs:
python-version:
required: true
type: string
os:
required: true
type: string
jobs:
build:
name: Compile (py${{ inputs.python-version }}, on ${{ inputs.os }})
runs-on: ${{ inputs.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get GSAS-II sources
shell: bash -l {0}
run: |
git clone --single-branch --branch main --depth 50 https://github.com/AdvancedPhotonSource/GSAS-II.git _gsas2
- uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: gcc
version: 12
- name: Set up minimal conda for build
#uses: conda-incubator/setup-miniconda@v3.0.3
uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3 using hash for security
with:
activate-environment: build
miniforge-version: latest
python-version: ${{ inputs.python-version }}
- name: Conda install for build
shell: bash -el {0}
run: |
# tailor the numpy version to match the GSAS-II binaries
if [ "${{ inputs.python-version }}" == "3.13" ]; then
npver="2.2 python-gil"
elif [ "${{ inputs.python-version }}" == "3.12" ]; then
npver=2.2
elif [ "${{ inputs.python-version }}" == "3.11" ]; then
npver=1.26
fi
conda install python=${{ inputs.python-version }} numpy=${npver} meson cython -c conda-forge --override-channels --quiet
- name: Compile MacOS
if: runner.os == 'macOS'
uses: ./.github/actions/meson-mac
- name: Compile Linux
if: runner.os == 'Linux'
uses: ./.github/actions/meson-linux
- name: Compile Windows
if: runner.os == 'Windows'
uses: ./.github/actions/meson-windows
job2:
name: test w/ (py${{ inputs.python-version }}, on ${{ inputs.os }})
runs-on: ${{ inputs.os }}
needs: build
steps:
# gfortran is here even without asking for it. Would prefer
# otherwise as I'd like to test if the binaries run w/o libraries
# installed
# - name: Test for compiler?
# id: compile-step
# shell: bash -l {0}
# run: |
# gfortran -v
- name: Set up minimal conda
#uses: conda-incubator/setup-miniconda@v3.0.3
uses: conda-incubator/setup-miniconda@030178870c779d9e5e1b4e563269f3aa69b04081 # v3.0.3 using hash for security
with:
activate-environment: build
miniforge-version: latest
python-version: ${{ inputs.python-version }}
- name: Conda install
shell: bash -el {0}
run: |
# tailor the numpy version to match the GSAS-II binaries
if [ "${{ inputs.python-version }}" == "3.13" ]; then
npver="2.2 python-gil"
elif [ "${{ inputs.python-version }}" == "3.12" ]; then
npver=2.2
elif [ "${{ inputs.python-version }}" == "3.11" ]; then
npver=1.26
fi
conda install python=${{ inputs.python-version }} numpy=${npver} scipy requests pytest git gitpython pycifrw seekpath -c conda-forge --override-channels --quiet
#conda info
#conda list
- name: GSAS-II install
shell: bash -el {0}
run: |
curl -L -O https://github.com/AdvancedPhotonSource/GSAS-II-buildtools/raw/main/install/gitstrap.py
python gitstrap.py --nocheck --noshortcut --branch=main
- name: GSAS-II all tests
shell: bash -el {0}
run: |
cd GSAS-II
python -m pytest