|
1 | 1 | name: Smoke Tests |
2 | 2 |
|
| 3 | +# Thin caller for PyAutoHeart's reusable smoke-test workflow. The ceremony |
| 4 | +# (chain checkout, branch matching, runner, Slack) lives centrally; this |
| 5 | +# workspace declares its dependency chain and owns its install epilogue |
| 6 | +# (.github/scripts/smoke_install.sh) and runner (.github/scripts/run_smoke.py). |
| 7 | + |
3 | 8 | on: [push, pull_request] |
4 | 9 |
|
5 | 10 | jobs: |
6 | 11 | smoke: |
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@v4 |
15 | | - with: |
16 | | - repository: PyAutoLabs/PyAutoConf |
17 | | - path: PyAutoConf |
18 | | - - name: Checkout PyAutoFit |
19 | | - uses: actions/checkout@v4 |
20 | | - with: |
21 | | - repository: PyAutoLabs/PyAutoFit |
22 | | - path: PyAutoFit |
23 | | - - name: Checkout PyAutoArray |
24 | | - uses: actions/checkout@v4 |
25 | | - with: |
26 | | - repository: PyAutoLabs/PyAutoArray |
27 | | - path: PyAutoArray |
28 | | - - name: Checkout PyAutoGalaxy |
29 | | - uses: actions/checkout@v4 |
30 | | - with: |
31 | | - repository: PyAutoLabs/PyAutoGalaxy |
32 | | - path: PyAutoGalaxy |
33 | | - - name: Checkout PyAutoLens |
34 | | - uses: actions/checkout@v4 |
35 | | - with: |
36 | | - repository: PyAutoLabs/PyAutoLens |
37 | | - path: PyAutoLens |
38 | | - - name: Checkout HowToLens |
39 | | - uses: actions/checkout@v4 |
40 | | - with: |
41 | | - path: workspace |
42 | | - - name: Set up Python ${{ matrix.python-version }} |
43 | | - uses: actions/setup-python@v5 |
44 | | - with: |
45 | | - python-version: ${{ matrix.python-version }} |
46 | | - - name: Extract branch name |
47 | | - id: extract_branch |
48 | | - shell: bash |
49 | | - run: | |
50 | | - cd workspace |
51 | | - echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_OUTPUT" |
52 | | - - name: Match library branches |
53 | | - shell: bash |
54 | | - run: | |
55 | | - BRANCH="${{ steps.extract_branch.outputs.branch }}" |
56 | | - for PKG in PyAutoConf PyAutoFit PyAutoArray PyAutoGalaxy PyAutoLens; do |
57 | | - pushd "$PKG" |
58 | | - if [[ -n "$(git ls-remote --heads origin "$BRANCH")" ]]; then |
59 | | - echo "Branch $BRANCH exists in $PKG — checking out" |
60 | | - git fetch origin "$BRANCH" |
61 | | - git checkout "$BRANCH" |
62 | | - else |
63 | | - echo "Branch $BRANCH not in $PKG — staying on main" |
64 | | - fi |
65 | | - popd |
66 | | - done |
67 | | - - name: Install dependencies |
68 | | - run: | |
69 | | - pip install --upgrade pip setuptools wheel |
70 | | - pip install pyyaml |
71 | | - if [ "${{ matrix.python-version }}" = "3.12" ]; then |
72 | | - pip install ./PyAutoConf ./PyAutoFit ./PyAutoArray ./PyAutoGalaxy ./PyAutoLens |
73 | | - pip install "./PyAutoArray[optional]" "./PyAutoGalaxy[optional]" "./PyAutoLens[optional]" |
74 | | - else |
75 | | - pip install ./PyAutoConf ./PyAutoFit ./PyAutoArray ./PyAutoGalaxy ./PyAutoLens |
76 | | - pip install numba |
77 | | - fi |
78 | | - pip install tensorflow-probability==0.25.0 |
79 | | - - name: Prepare cache dirs |
80 | | - run: | |
81 | | - mkdir -p /tmp/numba_cache /tmp/matplotlib |
82 | | - - name: Run smoke tests |
83 | | - env: |
84 | | - JAX_ENABLE_X64: "True" |
85 | | - NUMBA_CACHE_DIR: /tmp/numba_cache |
86 | | - MPLCONFIGDIR: /tmp/matplotlib |
87 | | - run: | |
88 | | - cd workspace |
89 | | - python .github/scripts/run_smoke.py |
90 | | - - name: Slack notify on failure |
91 | | - if: ${{ failure() }} |
92 | | - uses: slackapi/slack-github-action@v1.21.0 |
93 | | - env: |
94 | | - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |
95 | | - with: |
96 | | - channel-id: C03S98FEDK2 |
97 | | - payload: | |
98 | | - { |
99 | | - "text": "${{ github.repository }}/${{ github.ref_name }} smoke tests (Python ${{ matrix.python-version }}) ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" |
100 | | - } |
| 12 | + uses: PyAutoLabs/PyAutoHeart/.github/workflows/smoke-tests.yml@main |
| 13 | + with: |
| 14 | + chain: "PyAutoConf PyAutoFit PyAutoArray PyAutoGalaxy PyAutoLens" |
| 15 | + secrets: inherit |
0 commit comments