-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (81 loc) · 2.81 KB
/
Copy pathtest_tools.yml
File metadata and controls
84 lines (81 loc) · 2.81 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
name: Test Tools
env:
TOOLS_PATH: ${{ github.workspace }}/tools
GH_ACTIONS_PATH: ${{ github.workspace }}/.github/workflows
MINQ_COMMIT_FILE: ${{ github.workspace }}/REQUIRED_MINQ_COMMIT
IBCDFO_PKG: ${{ github.workspace }}/ibcdfo_pypkg
BENDFO_PY_PATH: ${{ github.workspace }}/BenDFO/py
BENDFO_DATA_PATH: ${{ github.workspace }}/BenDFO/data
MINQ5_PY_PATH: ${{ github.workspace }}/MINQ/py/minq5
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
# ----- LOAD OFFICIAL MINQ COMMIT INFO FOR PROPER SETUP FOR IBCDFO
# Load this eagerly so that it is available for immediate use in all
# subsequent jobs.
load_minq_sha:
outputs:
minq_sha: ${{ steps.load_sha.outputs.minq_sha }}
runs-on: ubuntu-latest
steps:
- name: Checkout IBCDFO repository
uses: actions/checkout@v6
- name: Load Official MINQ SHA
id: load_sha
run: |
MINQ_SHA=$(cat $MINQ_COMMIT_FILE)
echo "The valid MINQ commit hash is $MINQ_SHA"
echo "minq_sha=$MINQ_SHA" >> "$GITHUB_OUTPUT"
# Prefer using the latest Python version supported by the package
test_tools:
runs-on: ubuntu-latest
needs: load_minq_sha
env:
MINQ_SHA: ${{ needs.load_minq_sha.outputs.minq_sha }}
steps:
# -- General Setup Steps
# This action requires minq
- name: Checkout IBCDFO repository
uses: actions/checkout@v6
- name: Checkout MINQ repository
uses: actions/checkout@v6
with:
repository: POptUS/MINQ
path: MINQ
ref: ${{ env.MINQ_SHA }}
- name: Checkout BenDFO repository
uses: actions/checkout@v6
with:
repository: POptUS/BenDFO
path: BenDFO
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.14"
- name: Setup Python with tox
run: $GH_ACTIONS_PATH/setup_tox_github_action.sh ${{ runner.os }}
- name: Build and install package
run: |
pushd $IBCDFO_PKG
python -m build --wheel
python -m pip install dist/ibcdfo-*-py3-none-any.whl
popd
python -m pip list
# -- Run each tool individually
# The check_python_standards action already uses
# * check_flake8_compliance.sh and
# * format_with_black.sh
# so we don't test them here as well.
#
# We would like to have a MATLAB test block that runs test_ibcdfo.m.
# However, the MINQ unittests require manual user input, which is
# incompatible with running MATLAB in actions (TBC).
- name: Use tools
run: |
export PYTHONPATH=$BENDFO_PY_PATH:$MINQ5_PY_PATH
echo "PYTHONPATH=$PYTHONPATH" >> $GITHUB_ENV
cp $BENDFO_DATA_PATH/dfo.dat .
$TOOLS_PATH/test_ibcdfo_python_installation.py