-
Notifications
You must be signed in to change notification settings - Fork 19
94 lines (76 loc) · 2.65 KB
/
stubs.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
name: 🔄 Update Stub Files
# This workflow updates the .pyi stub files for documentation and interactive use.
on:
workflow_call:
secrets:
PYAMREX_PUSH_TOKEN:
required: true
concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-stubs
cancel-in-progress: true
jobs:
# Build and install libamrex as AMReX CMake project
stubs:
name: Stubs
runs-on: ubuntu-22.04
env:
CC: gcc
CXX: g++
CXXFLAGS: "-O1"
OMP_NUM_THREAD: 4
steps:
- uses: actions/checkout@v4
if: github.event_name != 'push' || github.repository != 'AMReX-Codes/pyamrex' || github.ref != 'refs/heads/development'
- uses: actions/checkout@v4
if: github.event_name == 'push' && github.repository == 'AMReX-Codes/pyamrex' && github.ref == 'refs/heads/development'
with:
token: ${{ secrets.PYAMREX_PUSH_TOKEN }}
- name: Pull Remote Changes
if: github.event_name == 'push' && github.repository == 'AMReX-Codes/pyamrex' && github.ref == 'refs/heads/development'
run: git pull
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
- name: Dependencies
run: |
.github/workflows/dependencies/dependencies_gcc10.sh
.github/workflows/dependencies/dependencies_ccache.sh
- name: Set Up Cache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
restore-keys: |
ccache-${{ github.workflow }}-${{ github.job }}-git-
- name: Build & Install
run: |
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=10
export CCACHE_MAXSIZE=200M
ccache -z
python3 -m pip install -U pip setuptools wheel
python3 -m pip install -U pip mpi4py pytest pybind11-stubgen pre-commit
cmake -S . -B build -DAMReX_SPACEDIM="1;2;3" -DpyAMReX_IPO=OFF
cmake --build build -j 4 --target pip_install
ccache -s
du -hs ~/.cache/ccache
- name: Update Stubs
run: |
.github/update_stub.sh
- name: Run pre-commit cleanup
run: |
git add .
pre-commit run -a || true
git add .
- name: Update Install
run: |
cmake --build build -j 4 --target pip_install
- name: Unit tests
run: |
mpiexec -np 1 python3 -m pytest tests/
- uses: stefanzweifel/git-auto-commit-action@v5
name: Commit Updated Stub Files
if: github.event_name == 'push' && github.repository == 'AMReX-Codes/pyamrex' && github.ref == 'refs/heads/development'
with:
commit_message: Update Stub Files