diff --git a/.github/workflows/ci_workflows.yml b/.github/workflows/ci_workflows.yml new file mode 100644 index 0000000..2c91ff1 --- /dev/null +++ b/.github/workflows/ci_workflows.yml @@ -0,0 +1,37 @@ +on: + push: + pull_request: + workflow_dispatch: + + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + jobs: + + tests: + uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1 + with: + envs: | + - windows: py39-test-numpy122 + - linux: py310-test-numpy124 + - macos: py311-test-astropy53 + - linux: py312-test + - linux: codestyle + coverage: 'codecov' + + publish: + needs: tests + uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1 + 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 }} diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml deleted file mode 100644 index 1d79eff..0000000 --- a/.github/workflows/python-tests.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Run unit tests - -on: - pull_request: - push: - branches: [ main ] - tags: - workflow_dispatch: - -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@v4 - with: - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - 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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index c6c3a2e..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Build and upload to PyPI - -# Build on every branch push, tag push, and pull request change: -on: [push, pull_request] - -jobs: - build_wheels: - name: Build wheels on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - # macos-13 is an intel runner, macos-14 is apple silicon - os: [ubuntu-latest, windows-latest, macos-13, macos-14] - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Build wheels - uses: pypa/cibuildwheel@v2.17.0 - - - uses: actions/upload-artifact@v4 - with: - name: wheels-${{ matrix.os }} - path: ./wheelhouse/*.whl - - build_sdist: - name: Build source distribution - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: actions/setup-python@v5 - name: Install Python - with: - python-version: '3.12' - - - name: Build sdist - run: | - python -m pip install build - python -m build --sdist - - - uses: actions/upload-artifact@v4 - with: - name: sdist - path: dist/*.tar.gz - - upload_pypi: - needs: [build_wheels, build_sdist] - runs-on: ubuntu-latest - # upload to PyPI on every tag - if: startsWith(github.ref, 'refs/tags') - steps: - - uses: actions/download-artifact@v4 - with: - name: sdist - path: dist - - - uses: actions/download-artifact@v4 - with: - path: dist - pattern: wheels-* - - - uses: pypa/gh-action-pypi-publish@v1 - with: - user: __token__ - password: ${{ secrets.pypi_token }} - # To test: repository_url: https://test.pypi.org/legacy/