[pre-commit.ci] pre-commit autoupdate #238
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI | |
on: | |
push: | |
branches: ["master"] | |
pull_request: | |
branches: ["master"] | |
repository_dispatch: | |
types: rebuild | |
jobs: | |
tests: | |
name: "Python ${{ matrix.python-version }}" | |
runs-on: "ubuntu-20.04" | |
env: | |
USING_COVERAGE: '3.8' | |
TOX_PARALLEL_NO_SPINNER: 1 | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9"] | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: "actions/checkout@v2" | |
- name: "Install miniconda" | |
run: | | |
if [[ ! -z $INSTALL_MINICONDA ]]; then source tools/github/install_miniconda.sh; fi | |
- name: "Setup miniconda" | |
uses: "conda-incubator/setup-miniconda@v2" | |
with: | |
auto-update-conda: true | |
python-version: "${{ matrix.python-version }}" | |
channels: "conda-forge,anaconda" | |
- name: "Install dependencies" | |
run: | | |
set -xe | |
which python | |
python -VV | |
python -m site | |
python -m pip install --upgrade pip setuptools | |
python -m pip install --upgrade pytest coverage[toml] tox tox-conda tox-gh-actions | |
- name: "Run tox targets for ${{ matrix.python-version }}" | |
run: | | |
python -m pytest --version | |
python -m tox -v -p 2 # Only use 2 CPUs so coverage-report runs after pytest | |
- name: "Get coverage" | |
run: | | |
set -xe | |
python -m coverage combine | |
python -m coverage xml | |
if: "contains(env.USING_COVERAGE, matrix.python-version)" | |
- name: Upload coverage to Codecov | |
if: "contains(env.USING_COVERAGE, matrix.python-version)" | |
uses: "codecov/codecov-action@v1" | |
with: | |
fail_ci_if_error: true | |
package: | |
name: "Build & verify package" | |
runs-on: "ubuntu-20.04" | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: "Check out range-streams" | |
uses: "actions/checkout@v2" | |
- name: "Install miniconda" | |
run: | | |
if [[ ! -z $INSTALL_MINICONDA ]]; then source tools/github/install_miniconda.sh; fi | |
- name: "Setup miniconda" | |
uses: "conda-incubator/setup-miniconda@v2" | |
with: | |
auto-update-conda: true | |
python-version: "3.9" | |
channels: "conda-forge,anaconda" | |
- name: "Install build, and check-wheel-content" | |
run: "python -m pip install build check-wheel-contents" | |
- name: "Build package" | |
run: "python -m build --sdist --wheel ." | |
- name: "List result" | |
run: "ls -l dist" | |
- name: "Check wheel contents" | |
run: "check-wheel-contents dist/*.whl" | |
install-dev: | |
strategy: | |
matrix: | |
os: ["ubuntu-20.04"] | |
name: "Verify dev env" | |
runs-on: "${{ matrix.os }}" | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: "actions/checkout@v2" | |
- name: "Install miniconda" | |
run: | | |
if [[ ! -z $INSTALL_MINICONDA ]]; then source tools/github/install_miniconda.sh; fi | |
- name: "Setup miniconda" | |
uses: "conda-incubator/setup-miniconda@v2" | |
with: | |
auto-update-conda: true | |
python-version: "3.8" | |
channels: "conda-forge,anaconda" | |
- name: "Install in dev mode" | |
run: | | |
echo "CONDA=$CONDA" | |
echo "python=$(which python)" | |
echo "conda=$(which conda)" | |
python -m pip install -e .[dev] | |
- name: "Import package" | |
run: "python -c 'import range_streams; print(range_streams)'" |