-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (134 loc) · 5.11 KB
/
test.yml
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
---
name: Test
on:
push:
merge_group:
schedule:
- cron: 0 13 * * 1
workflow_dispatch:
jobs:
lint:
name: Format, lint, and type check
runs-on: macos-15
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
- name: Install artisatomic
run: |
uv sync --frozen
source .venv/bin/activate
uv pip install --compile-bytecode --editable .[dev]
- name: Run Ruff
if: always()
uses: astral-sh/ruff-action@v2
with:
version: 0.8.3
args: check --exit-non-zero-on-fix --no-fix
- name: Run Ruff Format
if: always()
uses: astral-sh/ruff-action@v2
with:
version: 0.8.3
args: format --check
- name: Lint with mypy
run: |
uv run --frozen mypy --install-types --non-interactive
pytest:
runs-on: macos-15
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
- name: Install artisatomic
run: |
uv sync --frozen
uv pip install --compile-bytecode --editable .[dev]
- name: Cache CMFGEN atomic data
uses: actions/cache@v4
id: cache-cmfgendata
with:
path: atomic-data-hillier/atomic_data_15nov16.tar.xz
key: atomic-data-hillier/atomic_data_15nov16.tar.xz
- name: Download/extract CMFGEN atomic data
working-directory: atomic-data-hillier/
run: source ./setup_cmfgen_data.sh
- name: Test with pytest
run: uv run --frozen python3 -m pytest
tests:
strategy:
matrix:
testname: [cmfgen, jplt, floers25]
fail-fast: false
runs-on: macos-15
timeout-minutes: 45
name: test ${{ matrix.testname }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
- name: Install artisatomic
run: |
uv sync --frozen
uv pip install --compile-bytecode --editable .[dev]
- name: Cache CMFGEN atomic data
uses: actions/cache@v4
id: cache-cmfgendata
with:
path: atomic-data-hillier/atomic_data_15nov16.tar.xz
key: atomic-data-hillier/atomic_data_15nov16.tar.xz
- name: Download/extract CMFGEN atomic data
working-directory: atomic-data-hillier/
run: source ./setup_cmfgen_data.sh
- name: Cache JPLT atomic data
if: matrix.testname == 'jplt'
uses: actions/cache@v4
id: cache-jpltdata
with:
path: atomic-data-tanaka-jplt/data_v1.1/**
key: atomic-data-tanaka-jplt/data_v1.1
- name: Download/extract JPLT atomic data
if: matrix.testname == 'jplt'
working-directory: atomic-data-tanaka-jplt/
run: source ./setup_jplt_data.sh
- name: Extract Floers25 atomic data
if: matrix.testname == 'floers25'
working-directory: atomic-data-floers25/
run: tar -zxvf testdata.tar.xz
- name: Generate artis atomic data files
run: |
cp tests/${{ matrix.testname }}/artisatomicionhandlers.json .
uv run --frozen makeartisatomicfiles -output_folder tests/${{ matrix.testname }}/output
- name: Checksum output files
working-directory: tests/${{ matrix.testname }}/output
run: |
cat compositiondata.txt
cat *.json
echo
md5sum *.txt atomic_data_logs/*.txt
md5sum -c ../checksums.txt
- name: tar and zip output files
if: always()
run: |
tar -cvzf artis_files_${{ matrix.testname }}.tar.gz tests/${{ matrix.testname }}/output/*
- name: Upload output files
if: always()
uses: actions/upload-artifact@v4
with:
name: artis_files_${{ matrix.testname }}.tar.gz
path: artis_files_${{ matrix.testname }}.tar.gz