Skip to content

Bump mamba-org/setup-micromamba from 1 to 2 #11

Bump mamba-org/setup-micromamba from 1 to 2

Bump mamba-org/setup-micromamba from 1 to 2 #11

Workflow file for this run

name: Unit Tests & Code Coverage
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch: # allow manual triggering
defaults:
run:
shell: bash -l {0}
jobs:
lint:
name: Code style
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
- name: Run flake8
run: flake8
- name: Run black
uses: rickstaa/action-black@v1
with:
black_args: ". --check"
- name: Run isort
uses: isort/isort-action@master
tests:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
needs: lint
strategy:
matrix:
python-version:
# - "3.12" # not yet
- "3.11"
- "3.10"
- "3.9"
- "3.8"
max-parallel: 5
env:
DISPLAY: ":99.0"
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Set timezone
uses: szenius/[email protected]
with:
timezoneLinux: "America/Chicago"
- name: Install OS libraries to test Linux PyQt apps
run: |
sudo apt update -y
sudo apt install -y \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xfixes0 \
libxkbcommon-x11-0 \
x11-utils \
xvfb
- name: Create Python ${{ matrix.python-version }} environment
uses: mamba-org/setup-micromamba@v2
with:
cache-environment: true
cache-environment-key: env-key-${{ matrix.python-version }}
condarc: |
channel-priority: flexible
environment-file: env.yml
environment-name: anaconda-test-env-py-${{ matrix.python-version }}
create-args: >-
coveralls
pytest
pytest-cov
pytest-qt
pytest-xvfb
python=${{ matrix.python-version }}
setuptools-scm
- name: Initial diagnostics
run: |
micromamba info
micromamba list
conda config --show-sources
conda config --show
micromamba env list
printenv | sort
- name: Install this package
shell: bash -l {0}
run: pip install --no-deps -e .
- name: Run tests with pytest
shell: bash -l {0}
run: |
xvfb-run pytest -vvv .