File: tests.yml

package info (click to toggle)
fiona 1.10.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,632 kB
  • sloc: python: 12,616; makefile: 214; sh: 45
file content (155 lines) | stat: -rw-r--r-- 4,846 bytes parent folder | download | duplicates (2)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Tests

on:
  push:
    branches: [ main, 'maint-*' ]
    paths:
      - '.github/workflows/tests.yml'
      - 'requirements*.txt'
      - 'setup.py'
      - 'setup.cfg'
      - 'MANIFEST.in'
      - 'pyproject.toml'
      - 'fiona/**'
      - 'tests/**'
  pull_request:
    branches: [ main, 'maint-*' ]
    paths:
      - '.github/workflows/tests.yml'
      - 'requirements*.txt'
      - 'setup.py'
      - 'setup.cfg'
      - 'MANIFEST.in'
      - 'pyproject.toml'
      - 'fiona/**'
      - 'tests/**'
  schedule:
    - cron:  '0 0 * * 0'

permissions:
  contents: read

jobs:
  docker_tests:
    runs-on: ubuntu-latest
    name: Docker | GDAL=${{ matrix.gdal-version }} | python=${{ matrix.python-version }}
    container: ghcr.io/osgeo/gdal:ubuntu-small-${{ matrix.gdal-version }}
    env:
        DEBIAN_FRONTEND: noninteractive
    strategy:
      fail-fast: false
      matrix:
        include:
          - python-version: '3.8'
            gdal-version: '3.4.3'
          - python-version: '3.9'
            gdal-version: '3.5.3'
          - python-version: '3.10'
            gdal-version: '3.6.4'
          - python-version: '3.11'
            gdal-version: '3.7.3'
          - python-version: '3.12'
            gdal-version: '3.8.3'

    steps:
      - uses: actions/checkout@v4.1.3

      - name: Update
        run: |
          apt-get update
          apt-get -y install software-properties-common
          add-apt-repository -y ppa:deadsnakes/ppa
          apt-get update

      - name: Set up Python ${{ matrix.python-version }}
        run: |
          apt-get install -y --no-install-recommends \
            python${{ matrix.python-version }} \
            python${{ matrix.python-version }}-dev \
            python${{ matrix.python-version }}-venv \
            python3-pip \
            g++

      - name: Install dependencies
        run: |
          python${{ matrix.python-version }} -m venv testenv
          . testenv/bin/activate
          python -m pip install --upgrade pip
          python -m pip wheel -r requirements-dev.txt
          python -m pip install -r requirements-dev.txt
          python setup.py clean
          python -m pip install --no-deps --force-reinstall -e .[test]

      - name: Run tests
        run: |
          . testenv/bin/activate
          python -m pytest -v -m "not wheel or gdal" -rxXs --cov fiona --cov-report term-missing

  conda_test:
    name: Conda | ${{ matrix.os }} | python=${{ matrix.python-version }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: true
      matrix:
        include:
          - os: macos-13
            python-version: '3.12'
          - os: macos-14
            python-version: '3.12'
          - os: windows-latest
            python-version: '3.12'
    steps:
      - uses: actions/checkout@v4

      - name: Conda Setup
        uses: conda-incubator/setup-miniconda@v3
        with:
          miniforge-variant: Mambaforge
          miniforge-version: latest
          use-mamba: true
          auto-update-conda: true
          use-only-tar-bz2: false
          python-version: ${{ matrix.python-version }}

      - name: Install Env (OSX)
        if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
        shell: bash -l {0}
        run: |
          conda config --prepend channels conda-forge
          conda config --set channel_priority strict
          conda create -n test python=${{ matrix.python-version }} libgdal geos=3.12 cython=3
          conda activate test
          python -m pip install -e . || python -m pip install -e .
          python -m pip install -r requirements-dev.txt

      - name: Install Env (Windows)
        if: matrix.os == 'windows-latest'
        shell: bash -l {0}
        run: |
          conda config --prepend channels conda-forge
          conda config --set channel_priority strict
          conda create -n test python=${{ matrix.python-version }} libgdal geos=3.12 cython=3
          conda activate test
          GDAL_VERSION="3.7" python setup.py build_ext -I"/c/Users/runneradmin/miniconda3/envs/test/Library/include" -lgdal -L"/c/Users/runneradmin/miniconda3/envs/test/Library/lib" install
          python -m pip install -r requirements-dev.txt

      - name: Check and Log Environment
        shell: bash -l {0}
        run: |
          conda activate test
          python -V
          conda info

      - name: Test with Coverage (Windows)
        if: matrix.os == 'windows-latest'
        shell: bash -l {0}
        run: |
          conda activate test
          pytest -v -m "not wheel" -rxXs --cov fiona --cov-report term-missing

      - name: Test with Coverage (OSX)
        if: matrix.os == 'macos-13'
        shell: bash -l {0}
        run: |
          conda activate test
          python -m pytest -v -m "not wheel" -rxXs  --cov fiona --cov-report term-missing