diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/ci.yml | 86 | ||||
-rw-r--r-- | .github/workflows/docs.yml | 46 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 17 |
3 files changed, 149 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..676b456 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,86 @@ +name: CI + +on: [push, pull_request] + +jobs: + test: + strategy: + matrix: + python-version: [3.6, 3.7, 3.8] + numpy: [null, "numpy>=1.14,<2.0.0"] + uncertainties: [null, "uncertainties==3.0.1", "uncertainties>=3.0.1,<4.0.0"] + extras: [null] + include: + - python-version: 3.6 + numpy: numpy==1.14.6 + extras: matplotlib==2.2.5 + - python-version: 3.8 + numpy: "numpy" + uncertainties: "uncertainties" + extras: "sparse xarray netCDF4 dask[complete] graphviz babel==2.8" + - python-version: 3.9 + numpy: numpy + + runs-on: ubuntu-latest + + env: + TEST_OPTS: "-rfsxEX -s --cov=pint --cov-config=.coveragerc" + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 100 + + - name: Get tags + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Get pip cache dir + id: pip-cache + run: echo "::set-output name=dir::$(pip cache dir)" + + - name: Setup caching + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: pip-${{ matrix.python-version }} + restore-keys: | + pip-${{ matrix.python-version }} + + - name: Install numpy + if: ${{ matrix.numpy != null }} + run: pip install "${{matrix.numpy}}" + + - name: Install uncertainties + if: ${{ matrix.uncertainties != null }} + run: pip install "${{matrix.uncertainties}}" + + - name: Install extras + if: ${{ matrix.extras != null }} + run: pip install ${{matrix.extras}} + + - name: Install dependencies + run: | + sudo apt install -y graphviz + pip install .[test] + + - name: Run Tests + run: | + pytest $TEST_OPTS + + - name: Coverage report + run: coverage report -m + + finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true
\ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..5ed4fe7 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,46 @@ +name: Documentation Build + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 100 + + - name: Get tags + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Get pip cache dir + id: pip-cache + run: echo "::set-output name=dir::$(pip cache dir)" + + - name: Setup pip cache + uses: actions/cache@v2 + with: + path: ${{ steps.pip-cache.outputs.dir }} + key: pip-docs + restore-keys: pip-docs + + - name: Install dependencies + run: | + sudo apt install -y pandoc + pip install --upgrade pip setuptools wheel + pip install -r "requirements_docs.txt" + pip install docutils==0.14 commonmark==0.8.1 recommonmark==0.5.0 babel==2.8 + pip install . + + - name: Build documentation + run: sphinx-build -n -j auto -b html -d build/doctrees docs build/html + + - name: Doc Tests + run: sphinx-build -a -j auto -b doctest -d build/doctrees docs build/doctest +
\ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..b10a674 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,17 @@ +name: Lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: 3.x + - name: Lint + uses: pre-commit/action@v2.0.0 + with: + extra_args: --all-files --show-diff-on-failure
\ No newline at end of file |