|
1 | | -name: build |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [ master ] |
| 5 | + branches: [master] |
6 | 6 | pull_request: |
7 | | - branches: [ '*' ] |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
8 | 14 |
|
9 | 15 | jobs: |
10 | | - build: |
| 16 | + lint: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 20 | + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 21 | + with: |
| 22 | + python-version: "3.14" |
| 23 | + cache: pip |
| 24 | + - run: python -m pip install --upgrade pip |
| 25 | + - run: python -m pip install ".[dev]" |
| 26 | + - run: black --check --diff . |
| 27 | + - run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 28 | + |
| 29 | + linux: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + include: |
| 35 | + - python: "3.10" |
| 36 | + torch: "torch==2.6.*" |
| 37 | + - python: "3.12" |
| 38 | + torch: "torch" |
| 39 | + - python: "3.14" |
| 40 | + torch: "torch" |
| 41 | + steps: |
| 42 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 43 | + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 44 | + with: |
| 45 | + python-version: ${{ matrix.python }} |
| 46 | + cache: pip |
| 47 | + - run: python -m pip install --upgrade pip |
| 48 | + - run: python -m pip install "${{ matrix.torch }}" pytest pytest-xdist |
| 49 | + - run: python -m pip install --no-deps -e . |
| 50 | + - run: python -m pytest -s --tb=short -n32 test |
11 | 51 |
|
| 52 | + os-smoke: |
12 | 53 | runs-on: ${{ matrix.os }} |
13 | 54 | strategy: |
| 55 | + fail-fast: false |
14 | 56 | matrix: |
15 | | - python-version: [3.6, 3.7, 3.8] |
16 | 57 | os: [ubuntu-latest, macos-latest, windows-latest] |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 60 | + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 61 | + with: |
| 62 | + python-version: "3.13" |
| 63 | + cache: pip |
| 64 | + - run: python -m pip install --upgrade pip |
| 65 | + - run: python -m pip install ".[test]" |
| 66 | + - run: python -m pytest -s --tb=short -n32 test |
| 67 | + |
| 68 | + coverage: |
| 69 | + runs-on: ubuntu-latest |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 72 | + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 73 | + with: |
| 74 | + python-version: "3.14" |
| 75 | + cache: pip |
| 76 | + - run: python -m pip install --upgrade pip |
| 77 | + - run: python -m pip install ".[test]" pytest-cov |
| 78 | + - run: python -m pytest -s --tb=short -n32 --cov=geotorch --cov-report=xml test |
| 79 | + - uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 |
| 80 | + with: |
| 81 | + token: ${{ secrets.CODECOV_TOKEN }} |
17 | 82 |
|
| 83 | + package: |
| 84 | + runs-on: ubuntu-latest |
18 | 85 | steps: |
19 | | - - uses: actions/checkout@v2 |
20 | | - - name: Set up Python ${{ matrix.python-version }} |
21 | | - uses: actions/setup-python@v2 |
22 | | - with: |
23 | | - python-version: ${{ matrix.python-version }} |
24 | | - |
25 | | - - name: Install dependencies others |
26 | | - if: ${{ matrix.os != 'windows-latest' }} |
27 | | - run: | |
28 | | - python -m pip install --upgrade pip |
29 | | - pip install .[dev] |
30 | | -
|
31 | | - # Windows is treated differently, as PyTorch is not uploaded to Pypi atm |
32 | | - - name: Install dependencies windows |
33 | | - if: ${{ matrix.os == 'windows-latest' }} |
34 | | - run: | |
35 | | - python -m pip install --upgrade pip |
36 | | - pip install torch===1.10.0+cpu -f https://download.pytorch.org/whl/torch_stable.html |
37 | | - pip install .[dev] |
38 | | -
|
39 | | - - name: Lint with flake8 |
40 | | - run: | |
41 | | - # stop the build if there are Python syntax errors or undefined names |
42 | | - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
43 | | - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
44 | | - flake8 . --count --exit-zero --max-complexity=12 --max-line-length=127 --statistics |
45 | | -
|
46 | | - - name: Lint with Black |
47 | | - run: | |
48 | | - black --check --diff . |
49 | | -
|
50 | | - - name: Test with pytest |
51 | | - run: | |
52 | | - pytest test |
| 86 | + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 |
| 87 | + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 |
| 88 | + with: |
| 89 | + python-version: "3.14" |
| 90 | + cache: pip |
| 91 | + - run: python -m pip install --upgrade pip |
| 92 | + - run: python -m pip install build pytest pytest-xdist torch twine |
| 93 | + - run: python -m build |
| 94 | + - run: python -m twine check dist/* |
| 95 | + - run: python .github/scripts/check_dist.py dist/* |
| 96 | + - name: Test installed wheel |
| 97 | + run: | |
| 98 | + python -m venv --system-site-packages /tmp/geotorch-wheel |
| 99 | + /tmp/geotorch-wheel/bin/python -m pip install --no-deps dist/*.whl |
| 100 | + cp -R test /tmp/geotorch-tests |
| 101 | + cd /tmp |
| 102 | + /tmp/geotorch-wheel/bin/python -m pytest -s --tb=short -n32 geotorch-tests |
0 commit comments