|
1 | | -name: Tests |
2 | | - |
3 | | -on: [push, pull_request] |
4 | | - |
5 | | -jobs: |
6 | | - unittest: |
7 | | - runs-on: ubuntu-latest |
8 | | - strategy: |
9 | | - fail-fast: false |
10 | | - matrix: |
11 | | - python-version: ['3.12', '3.13'] |
12 | | - steps: |
13 | | - - name: Checkout PyAutoConf |
14 | | - uses: actions/checkout@v2 |
15 | | - with: |
16 | | - repository: PyAutoLabs/PyAutoConf |
17 | | - path: PyAutoConf |
18 | | - - name: Checkout PyAutoFit |
19 | | - uses: actions/checkout@v2 |
20 | | - with: |
21 | | - repository: PyAutoLabs/PyAutoFit |
22 | | - path: PyAutoFit |
23 | | - - name: Checkout PyAutoArray |
24 | | - uses: actions/checkout@v2 |
25 | | - with: |
26 | | - repository: PyAutoLabs/PyAutoArray |
27 | | - path: PyAutoArray |
28 | | - - name: Checkout PyAutoGalaxy |
29 | | - uses: actions/checkout@v2 |
30 | | - with: |
31 | | - repository: PyAutoLabs/PyAutoGalaxy |
32 | | - path: PyAutoGalaxy |
33 | | - - name: Checkout PyAutoLens |
34 | | - uses: actions/checkout@v2 |
35 | | - with: |
36 | | - path: PyAutoLens |
37 | | - - name: Set up Python ${{ matrix.python-version }} |
38 | | - uses: actions/setup-python@v2 |
39 | | - with: |
40 | | - python-version: ${{ matrix.python-version }} |
41 | | - - name: Extract branch name |
42 | | - shell: bash |
43 | | - run: | |
44 | | - cd PyAutoLens |
45 | | - echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" |
46 | | - id: extract_branch |
47 | | - - name: Change to same branch if exists in deps |
48 | | - shell: bash |
49 | | - run: | |
50 | | - export PACKAGES=("PyAutoConf" "PyAutoArray" "PyAutoFit" "PyAutoGalaxy") |
51 | | - export BRANCH="${{ steps.extract_branch.outputs.branch }}" |
52 | | - for PACKAGE in ${PACKAGES[@]}; do |
53 | | - pushd $PACKAGE |
54 | | - export existed_in_remote=$(git ls-remote --heads origin ${BRANCH}) |
55 | | -
|
56 | | - if [[ -z ${existed_in_remote} ]]; then |
57 | | - echo "Branch $BRANCH did not exist in $PACKAGE" |
58 | | - else |
59 | | - echo "Branch $BRANCH did exist in $PACKAGE" |
60 | | - git fetch |
61 | | - git checkout $BRANCH |
62 | | - fi |
63 | | - popd |
64 | | - done |
65 | | - - name: Install dependencies |
66 | | - run: | |
67 | | - pip3 install --upgrade pip |
68 | | - pip3 install setuptools |
69 | | - pip3 install wheel |
70 | | - pip3 install pytest coverage pytest-cov |
71 | | - pip install ./PyAutoConf ./PyAutoFit "./PyAutoArray[optional]" "./PyAutoGalaxy[optional]" "./PyAutoLens[optional]" |
72 | | - - name: Run tests |
73 | | - run: | |
74 | | - export ROOT_DIR=`pwd` |
75 | | - export JAX_ENABLE_X64=True |
76 | | - export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoConf |
77 | | - export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoFit |
78 | | - export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoArray |
79 | | - export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoGalaxy |
80 | | - export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoLens |
81 | | - pushd PyAutoLens |
82 | | - pytest --cov autolens --cov-report xml:coverage.xml |
83 | | - - name: Slack send |
84 | | - if: ${{ failure() }} |
85 | | - id: slack |
86 | | - uses: slackapi/slack-github-action@v1.21.0 |
87 | | - env: |
88 | | - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
89 | | - with: |
90 | | - channel-id: C03S98FEDK2 |
91 | | - payload: | |
92 | | - { |
93 | | - "text": "${{ github.repository }}/${{ github.ref_name }} (Python ${{ matrix.python-version }}) build result: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" |
94 | | - } |
| 1 | +name: Tests |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +# Unit tests are defined once, centrally, in PyAutoPulse's reusable workflow |
| 6 | +# (Pulse owns all health/readiness checking). This thin caller preserves PR-time |
| 7 | +# gating: the `unittest` job is the required status check on this repo. |
| 8 | +jobs: |
| 9 | + unittest: |
| 10 | + uses: PyAutoLabs/PyAutoPulse/.github/workflows/lib-tests.yml@main |
| 11 | + with: |
| 12 | + package: autolens |
| 13 | + secrets: inherit |
0 commit comments