Skip to content

Merge pull request #91 from astropy/dependabot/github_actions/dot-git… #125

Merge pull request #91 from astropy/dependabot/github_actions/dot-git…

Merge pull request #91 from astropy/dependabot/github_actions/dot-git… #125

Workflow file for this run

name: Run unit tests
on:
push:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: ${{ matrix.name }} (${{ matrix.os }}, ${{ matrix.toxenv }})
runs-on: ${{ matrix.os }}
if: "!(contains(github.event.head_commit.message, '[skip ci]') || contains(github.event.head_commit.message, '[ci skip]'))"
strategy:
fail-fast: false
matrix:
include:
- name: Python 3.9 with required dependencies
os: windows-latest
python-version: 3.9
toxenv: py39-test-numpy122
- name: Python 3.10 with required dependencies
os: ubuntu-latest
python-version: "3.10"
toxenv: py310-test-numpy124
- name: Python 3.11 with required dependencies
os: macos-latest
python-version: "3.11"
toxenv: py311-test-astropy53
- name: Python 3.12 with required dependencies
os: ubuntu-latest
python-version: "3.12"
toxenv: py312-test
coverage: true
- name: Code style checks
os: ubuntu-latest
python-version: "3.12"
toxenv: codestyle
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install tox
- name: Run tests
if: "! matrix.coverage"
run: tox -v -e ${{ matrix.toxenv }}
- name: Run tests with coverage
if: "matrix.coverage"
run: |
pip install Cython extension-helpers numpy
COVERAGE=1 pip install -e .[test]
pytest --pyargs astroscrappy docs --cov astroscrappy
- name: Upload coverage to codecov
if: "matrix.coverage"
run: |
pip install codecov
codecov
publish:
needs: tests
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@d68193b68216da64eafaa618f53c59f5d271c56e # v1.14.0
with:
test_extras: test
test_command: pytest -p no:warnings --pyargs astroscrappy
targets: |
- cp*-manylinux_x86_64
- cp*-manylinux_aarch64
- cp*-macosx_x86_64
- cp*-macosx_arm64
- cp*-win_amd64
secrets:
pypi_token: ${{ secrets.pypi_token }}
anaconda_token: ${{ secrets.anaconda_token }}