|
1 | 1 | name: CI
|
2 | 2 |
|
3 | 3 | on:
|
| 4 | + schedule: |
| 5 | + # run every day at 4am UTC |
| 6 | + - cron: '0 4 * * *' |
4 | 7 | push:
|
5 |
| - branches: |
6 |
| - - main |
7 | 8 | pull_request:
|
8 | 9 | workflow_dispatch:
|
9 |
| - schedule: |
10 |
| - # Monthly, 1st of the month, 6am |
11 |
| - - cron: "0 6 1 * *" |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
12 | 14 |
|
13 | 15 | jobs:
|
14 |
| - build: |
15 |
| - runs-on: ${{ matrix.os }} |
16 |
| - strategy: |
17 |
| - matrix: |
18 |
| - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] |
19 |
| - os: [ubuntu-latest, macos-latest, windows-latest] |
20 |
| - steps: |
21 |
| - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 |
22 |
| - with: |
23 |
| - fetch-depth: 0 |
24 |
| - - name: Set up Python ${{ matrix.python-version }} |
25 |
| - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 |
26 |
| - with: |
27 |
| - python-version: ${{ matrix.python-version }} |
28 |
| - - name: Install dependencies |
29 |
| - run: | |
30 |
| - python -m pip install --upgrade pip |
31 |
| - pip install build twine |
32 |
| - - name: Build sdist/wheel and check metadata |
33 |
| - run: | |
34 |
| - python -m build |
35 |
| - python -m twine check --strict dist/* |
36 | 16 |
|
37 |
| - test: |
38 |
| - runs-on: ${{ matrix.os }} |
39 |
| - strategy: |
40 |
| - matrix: |
41 |
| - python-version: ["3.8", "3.9", "3.10", "3.11"] |
42 |
| - os: [ubuntu-latest, macos-latest, windows-latest] |
43 |
| - include: |
44 |
| - - python-version: "3.7" |
45 |
| - os: ubuntu-latest |
46 |
| - name: oldest-dependencies |
47 |
| - steps: |
48 |
| - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 |
49 |
| - with: |
50 |
| - fetch-depth: 0 |
51 |
| - - name: Set up Python ${{ matrix.python-version }} |
52 |
| - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 |
53 |
| - with: |
54 |
| - python-version: ${{ matrix.python-version }} |
55 |
| - - name: Install oldest dependencies |
56 |
| - if: ${{ contains(matrix.name,'oldest') }} |
57 |
| - run: | |
58 |
| - python -m pip install --upgrade pip |
59 |
| - pip install astropy~=4.0.0 numpy~=1.16.0 pyparsing~=2.0.0 |
60 |
| - - name: Install dependencies |
61 |
| - run: | |
62 |
| - python -m pip install --upgrade pip |
63 |
| - pip install .[test] |
64 |
| - - name: Test with pytest |
65 |
| - run: | |
66 |
| - pytest --import-mode=importlib --pyargs pyregion |
| 17 | + tests: |
| 18 | + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 |
| 19 | + with: |
| 20 | + envs: | |
| 21 | + - macos: py310-test-oldestdeps |
| 22 | + - macos: py311-test |
| 23 | + - macos: py312-test |
| 24 | + - linux: py310-test-oldestdeps |
| 25 | + - linux: py311-test |
| 26 | + - linux: py312-test |
| 27 | + - linux: py312-test-devdeps |
| 28 | + - windows: py310-test-oldestdeps |
| 29 | + - windows: py311-test |
| 30 | + - windows: py312-test |
| 31 | + coverage: 'codecov' |
| 32 | + |
| 33 | + publish: |
| 34 | + needs: tests |
| 35 | + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@924441154cf3053034c6513d5e06c69d262fb9a6 # v1.13.0 |
| 36 | + with: |
| 37 | + test_extras: test |
| 38 | + test_command: pytest -p no:warnings --pyargs pyregion |
| 39 | + targets: | |
| 40 | + - cp*-manylinux_x86_64 |
| 41 | + - cp*-manylinux_aarch64 |
| 42 | + - cp*-macosx_x86_64 |
| 43 | + - cp*-macosx_arm64 |
| 44 | + - cp*-win_amd64 |
| 45 | +
|
| 46 | + secrets: |
| 47 | + pypi_token: ${{ secrets.pypi_token }} |
0 commit comments