@@ -2,79 +2,12 @@ name: Tests
22
33on : [push, pull_request]
44
5+ # Unit tests are defined once, centrally, in PyAutoHeart's reusable workflow
6+ # (Heart owns all health/readiness checking). This thin caller preserves PR-time
7+ # gating: the `unittest` job is the required status check on this repo.
58jobs :
69 unittest :
7- runs-on : ubuntu-latest
8- strategy :
9- matrix :
10- python-version : [3.9, '3.10', '3.11', '3.12']
11- steps :
12- - name : Checkout PyAutoConf
13- uses : actions/checkout@v2
14- with :
15- repository : rhayes777/PyAutoConf
16- path : PyAutoConf
17- - name : Checkout PyAutoFit
18- uses : actions/checkout@v2
19- with :
20- repository : rhayes777/PyAutoFit
21- path : PyAutoFit
22- - name : Checkout PyAutoArray
23- uses : actions/checkout@v2
24- with :
25- repository : Jammy2211/PyAutoArray
26- path : PyAutoArray
27- - name : Checkout PyAutoCTI
28- uses : actions/checkout@v2
29- with :
30- repository : Jammy2211/PyAutoCTI
31- path : PyAutoCTI
32- - name : Set up Python ${{ matrix.python-version }}
33- uses : actions/setup-python@v2
34- with :
35- python-version : ${{ matrix.python-version }}
36- - name : Extract branch name
37- shell : bash
38- run : |
39- cd PyAutoCTI
40- echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
41- id : extract_branch
42- - name : Change to same branch if exists in deps
43- shell : bash
44- run : |
45- export PACKAGES=("PyAutoConf" "PyAutoArray" "PyAutoFit")
46- export BRANCH="${{ steps.extract_branch.outputs.branch }}"
47- for PACKAGE in ${PACKAGES[@]}; do
48- pushd $PACKAGE
49- export existed_in_remote=$(git ls-remote --heads origin ${BRANCH})
50-
51- if [[ -z ${existed_in_remote} ]]; then
52- echo "Branch $BRANCH did not exist in $PACKAGE"
53- else
54- echo "Branch $BRANCH did exist in $PACKAGE"
55- git fetch
56- git checkout $BRANCH
57- fi
58- popd
59- done
60- - name : Install dependencies
61- run : |
62- pip3 install --upgrade pip
63- pip3 install setuptools
64- pip3 install wheel
65- pip3 install pytest coverage pytest-cov
66- pip3 install -r PyAutoConf/requirements.txt
67- pip3 install -r PyAutoFit/requirements.txt
68- pip3 install -r PyAutoArray/requirements.txt
69- pip3 install -r PyAutoArray/optional_requirements.txt
70- pip3 install -r PyAutoCTI/requirements.txt
71- pip3 install -r PyAutoCTI/optional_requirements.txt
72- - name : Run tests
73- run : |
74- export ROOT_DIR=`pwd`
75- export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoConf
76- export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoFit
77- export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoArray
78- export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoCTI
79- pushd PyAutoCTI
80- pytest --cov autocti --cov-report xml:coverage.xml
10+ uses : PyAutoLabs/PyAutoHeart/.github/workflows/lib-tests.yml@main
11+ with :
12+ package : autocti
13+ secrets : inherit
0 commit comments