-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (81 loc) · 2.9 KB
/
generate_database.yml
File metadata and controls
94 lines (81 loc) · 2.9 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
name: Generate Databases
on:
push:
branches: ["main"]
tags: ["v*.*"]
pull_request:
types: [opened, reopened, synchronize]
jobs:
run-generate-database:
strategy:
fail-fast: false
matrix:
species: [Sr87, Sr88, Yb171, Yb173, Yb174]
include:
# use n_max=220 for tags and main, but only n_max=110 for PRs, etc.
- n_max: ${{ (startsWith(github.ref, 'refs/tags/') || contains(github.ref, 'main')) && 220 || 110 }}
# for isotopes with hyperfine structure, we only include high-l states up to n=110 (otherwise the database size gets too large)
- species: Sr87
extra_args: "--n-max-high-l 110"
- species: Yb171
extra_args: "--n-max-high-l 110"
- species: Yb173
extra_args: "--n-max-high-l 110"
name: ${{ matrix.species }}
runs-on: ubuntu-latest
timeout-minutes: 300
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
steps:
- uses: actions/checkout@v6
with:
submodules: 'true'
- uses: julia-actions/setup-julia@v2
with:
version: 1.12
arch: x64
- uses: julia-actions/cache@v3
- name: Instantiate julia environment and link local MQDT.jl
run: julia --project=. -e 'import Pkg; Pkg.develop(path="MQDT.jl"); Pkg.instantiate()'
- name: Install and link local rydstate python package
run: julia --project=. -e 'using CondaPkg; CondaPkg.withenv() do; run(`python -m pip install -e rydstate`); end'
- name: Run generate_database
run: julia --project=. generate_database.jl ${{ matrix.species }} --directory database --n-max ${{ matrix.n_max }} ${{ matrix.extra_args }}
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: database-${{ matrix.species }}
path: |
database/*/*.parquet
github-release:
name: Release database files to github releases
if: startsWith(github.ref, 'refs/tags/') # only release to github on tag pushes
needs: [run-generate-database]
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
steps:
- name: Download all the database files
uses: actions/download-artifact@v8
with:
path: database
pattern: database-*
merge-multiple: true
- name: Zip database folders
working-directory: database/
run: |
VERSION_TAG=${GITHUB_REF#refs/tags/}
for dir in */; do
if [[ "$dir" != *"$VERSION_TAG/" ]]; then
echo "Error: Version mismatch between folder $dir and version tag $VERSION_TAG"
exit 1
fi
zip -r "${dir%/}.zip" "$dir"
done
- name: Release zipped database folders
uses: softprops/action-gh-release@v2
with:
files: database/*.zip
draft: true