|
| 1 | +name: CI build and Python-System-matrix tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, ready_for_review, closed] |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + tag: |
| 9 | + description: Tag for manually running CI Build workflow |
| 10 | + required: False |
| 11 | + default: '' |
| 12 | + |
| 13 | +jobs: |
| 14 | + first_check: |
| 15 | + name: first code check / python-3.13 / ubuntu-latest |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - name: Set up Python |
| 20 | + uses: actions/setup-python@v5 |
| 21 | + with: |
| 22 | + python-version: '3.13' |
| 23 | + - name: Python info |
| 24 | + run: | |
| 25 | + which python |
| 26 | + python --version |
| 27 | + - name: Build package and create dev environment |
| 28 | + run: | |
| 29 | + python -m pip install --upgrade pip poetry |
| 30 | + poetry config virtualenvs.create false |
| 31 | + poetry install |
| 32 | + - name: Show pip list |
| 33 | + run: | |
| 34 | + pip list |
| 35 | + - name: Test with coverage |
| 36 | + run: | |
| 37 | + poetry run pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml |
| 38 | + - name: Correct coverage paths |
| 39 | + run: sed -i "s+$PWD/++g" coverage.xml |
| 40 | + - name: Run ruff linter |
| 41 | + run: ruff check --output-format=github |
| 42 | + |
| 43 | + |
| 44 | + build_pypi: |
| 45 | + name: Test pypi build |
| 46 | + runs-on: ubuntu-latest |
| 47 | + needs: first_check |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v4 |
| 50 | + - name: Set up Python 3.13 |
| 51 | + uses: actions/setup-python@v5 |
| 52 | + with: |
| 53 | + python-version: '3.13' |
| 54 | + - name: Python info |
| 55 | + run: | |
| 56 | + which python |
| 57 | + python --version |
| 58 | + - name: Install dependencies |
| 59 | + run: | |
| 60 | + python -m pip install --upgrade pip poetry |
| 61 | + poetry config virtualenvs.create false |
| 62 | + - name: Build package |
| 63 | + run: | |
| 64 | + poetry build |
| 65 | + - name: Test package |
| 66 | + run: | |
| 67 | + poetry install --only dev |
| 68 | + python -m twine check dist/* |
| 69 | + - name: Show pip list |
| 70 | + run: | |
| 71 | + pip list |
| 72 | + - name: Install development dependencies |
| 73 | + run: | |
| 74 | + poetry install |
| 75 | + - name: Show pip list again |
| 76 | + run: | |
| 77 | + pip list |
| 78 | + - name: Run tests |
| 79 | + run: | |
| 80 | + poetry run pytest |
| 81 | + - name: Show environment variables |
| 82 | + shell: bash -l {0} |
| 83 | + run: | |
| 84 | + env | sort |
| 85 | +
|
| 86 | + test_dev: |
| 87 | + name: test dev environment / python-${{ matrix.python-version }} / ${{ matrix.os }} |
| 88 | + runs-on: ${{ matrix.os }} |
| 89 | + needs: first_check |
| 90 | + strategy: |
| 91 | + fail-fast: false |
| 92 | + matrix: |
| 93 | + os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] |
| 94 | + python-version: ['3.10', '3.11', '3.12', '3.13'] |
| 95 | + steps: |
| 96 | + - uses: actions/checkout@v4 |
| 97 | + - name: Set up Python |
| 98 | + uses: actions/setup-python@v5 |
| 99 | + with: |
| 100 | + python-version: ${{ matrix.python-version }} |
| 101 | + - name: Python info |
| 102 | + run: | |
| 103 | + which python |
| 104 | + python --version |
| 105 | + - name: Install dependencies (includinv dev + chemistry) |
| 106 | + run: | |
| 107 | + python -m pip install --upgrade pip poetry |
| 108 | + poetry config virtualenvs.create false |
| 109 | + poetry install |
| 110 | + - name: Show pip list |
| 111 | + run: | |
| 112 | + pip list |
| 113 | + - name: Run tests |
| 114 | + run: | |
| 115 | + poetry run pytest |
0 commit comments