File: python-tests.yml

package info (click to toggle)
astroscrappy 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 720 kB
  • sloc: ansic: 827; python: 410; makefile: 112
file content (94 lines) | stat: -rw-r--r-- 2,873 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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.10 with required dependencies
            os: ubuntu-22.04  # gcc 11.2
            python-version: "3.10"
            toxenv: py310-test-numpy126

          - name: Python 3.11 with required dependencies
            os: macos-latest
            python-version: "3.11"
            toxenv: py311-test-astropy60

          - name: Python 3.12 with required dependencies
            os: ubuntu-24.04  # gcc 13.2
            python-version: "3.12"
            toxenv: py312-test-astropy70
            coverage: true

          - name: Python 3.13 with required dependencies
            os: windows-latest
            python-version: "3.13"
            toxenv: py313-test

          - name: Python 3.14 with required dependencies
            os: macos-latest
            python-version: "3.14"
            toxenv: py314-test

          - name: Code style checks
            os: ubuntu-latest
            python-version: "3.13"
            toxenv: codestyle

    steps:
    - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8  # v5.0.0
      with:
        fetch-depth: 0
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c  # v6.0.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@28e947497bed4d6ec3fa1d66d198e95a1d17bc63  # v2.2.1
    with:
      test_extras: test
      test_command: pytest -p no:warnings --pyargs astroscrappy
      targets: |
        - cp*-manylinux_x86_64
        - target: cp*-manylinux_aarch64
          runs-on: ubuntu-24.04-arm
        - cp*-macosx_x86_64
        - cp*-macosx_arm64
        - cp*-win_amd64
    secrets:
      pypi_token: ${{ secrets.pypi_token }}
      anaconda_token: ${{ secrets.anaconda_token }}