|
| 1 | +name: CI-pint-master |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + test: |
| 7 | + strategy: |
| 8 | + matrix: |
| 9 | + python-version: [3.9, "3.10", "3.11"] |
| 10 | + numpy: ["numpy>=1.20.3,<2.0.0"] |
| 11 | + pandas: ["pandas==2.0.2", ] |
| 12 | + pint: ["pint>=0.21.1"] |
| 13 | + |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + env: |
| 17 | + TEST_OPTS: "-rfsxEX -s --cov=pint_pandas --cov-config=.coveragerc" |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v2 |
| 21 | + with: |
| 22 | + fetch-depth: 100 |
| 23 | + |
| 24 | + - name: Get tags |
| 25 | + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* |
| 26 | + |
| 27 | + - name: Set up Python ${{ matrix.python-version }} |
| 28 | + uses: actions/setup-python@v2 |
| 29 | + with: |
| 30 | + python-version: ${{ matrix.python-version }} |
| 31 | + |
| 32 | + - name: Install pint |
| 33 | + run: python -m pip install git+https://github.com/hgrecco/pint.git@master |
| 34 | + |
| 35 | + - name: Get pip cache dir |
| 36 | + id: pip-cache |
| 37 | + run: echo "::set-output name=dir::$(pip cache dir)" |
| 38 | + |
| 39 | + - name: Setup caching |
| 40 | + uses: actions/cache@v2 |
| 41 | + with: |
| 42 | + path: ${{ steps.pip-cache.outputs.dir }} |
| 43 | + key: pip-${{ matrix.python-version }} |
| 44 | + restore-keys: | |
| 45 | + pip-${{ matrix.python-version }} |
| 46 | +
|
| 47 | + - name: Install numpy |
| 48 | + if: ${{ matrix.numpy != null }} |
| 49 | + run: pip install "${{matrix.numpy}}" |
| 50 | + |
| 51 | + - name: Install dependencies |
| 52 | + run: | |
| 53 | + pip install .[test] |
| 54 | +
|
| 55 | + - name: Install pandas |
| 56 | + if: ${{ matrix.pandas != null }} |
| 57 | + run: pip install "${{matrix.pandas}}" |
| 58 | + |
| 59 | + - name: Run Tests |
| 60 | + run: | |
| 61 | + pytest $TEST_OPTS |
| 62 | +
|
| 63 | + - name: Coverage report |
| 64 | + run: coverage report -m |
| 65 | + |
| 66 | + - name: Coveralls Parallel |
| 67 | + env: |
| 68 | + COVERALLS_FLAG_NAME: ${{ matrix.test-number }} |
| 69 | + COVERALLS_PARALLEL: true |
| 70 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + COVERALLS_SERVICE_NAME: github |
| 72 | + run: | |
| 73 | + pip install coveralls |
| 74 | + coveralls |
| 75 | +
|
| 76 | + coveralls: |
| 77 | + needs: test |
| 78 | + runs-on: ubuntu-latest |
| 79 | + steps: |
| 80 | + - uses: actions/setup-python@v2 |
| 81 | + with: |
| 82 | + python-version: 3.x |
| 83 | + - name: Coveralls Finished |
| 84 | + env: |
| 85 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 86 | + COVERALLS_SERVICE_NAME: github |
| 87 | + run: | |
| 88 | + pip install coveralls |
| 89 | + coveralls --finish |
| 90 | +
|
| 91 | + # Dummy task to summarize all. See https://github.com/bors-ng/bors-ng/issues/1300 |
| 92 | + ci-success: |
| 93 | + name: ci |
| 94 | + if: ${{ success() }} |
| 95 | + needs: test |
| 96 | + runs-on: ubuntu-latest |
| 97 | + steps: |
| 98 | + - name: CI succeeded |
| 99 | + run: exit 0 |
0 commit comments