Merge pull request #300 from roocs/pre-commit-ci-update-config #672
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: CLISOPS Testing Suite | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
black: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
tox-env: | |
- black | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/cancel-workflow-action@0.11.0 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install tox | |
run: pip install tox~=4.0 | |
- name: Run linting suite | |
run: tox -e ${{ matrix.tox-env }} | |
pypi: | |
name: Pip with Python${{ matrix.python-version }} | |
needs: black | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- python-version: "3.8" | |
tox-env: py38 | |
- python-version: "3.9" | |
tox-env: py39 | |
- python-version: "3.10" | |
tox-env: py310 | |
- python-version: "3.11" | |
tox-env: py311 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install tox | |
run: | | |
python -m pip install tox~=4.0 | |
- name: Test with tox | |
run: | | |
tox -e ${{ matrix.tox-env }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_FLAG_NAME: run-${{ matrix.tox-env }} | |
COVERALLS_PARALLEL: true | |
COVERALLS_SERVICE_NAME: github | |
conda: | |
name: Anaconda Build with Python${{ matrix.python-version }} (upstream=${{ matrix.upstream }}) | |
needs: black | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- python-version: "3.9" | |
upstream: true | |
- python-version: "3.10" | |
upstream: false | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }} | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
cache-downloads: true | |
cache-environment: true | |
environment-file: environment.yml | |
create-args: >- | |
conda | |
python=${{ matrix.python-version }} | |
- name: Conda and Mamba versions | |
run: | | |
conda --version | |
echo "micromamba: $(micromamba --version)" | |
- name: Install CLISOPS | |
run: | | |
python -m pip install --no-user --editable ".[dev]" | |
- name: Install upstream dependencies | |
if: ${{ matrix.upstream }} | |
run: | | |
python -m pip install -r requirements_upstream.txt | |
- name: Check versions | |
run: | | |
conda list | |
- name: Test with conda | |
run: | | |
pytest --cov tests | |
finish: | |
needs: | |
- pypi | |
runs-on: ubuntu-latest | |
container: python:3-slim | |
steps: | |
- name: Coveralls Finished | |
run: | | |
pip install --upgrade coveralls | |
coveralls --finish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_SERVICE_NAME: github |