This repository has been archived by the owner on Nov 13, 2024. It is now read-only.
Fix DataLogger multi plot widget closing unexpectedly. #38
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: pyleco extras tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
docs_lint: | |
name: Docs and Linting | |
runs-on: "ubuntu-latest" | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install general requirements | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: .github/environment.yml | |
cache-environment-key: pylatest-ubuntu-latest-mamba-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | |
cache-downloads: false | |
- name: Python and Mamba version | |
run: | | |
python --version | |
micromamba info | |
- name: Lint with ruff | |
uses: chartboost/ruff-action@v1 | |
with: | |
version: 0.4.10 # ruff-action@v1 is broken in regard to ruff 0.5.0 | |
args: --extend-select=E9,F63,F7,F82 --show-source | |
# - uses: ammaraskar/sphinx-problem-matcher@master | |
# - name: Generate docs | |
# if: always() # run even if the previous step failed | |
# working-directory: ./docs | |
# run: | | |
# echo "::add-matcher::.github/sphinx.json" | |
# make html SPHINXOPTS="-W --keep-going" | |
# - name: Run doctests | |
# if: always() # run even if the previous step failed | |
# working-directory: ./docs | |
# run: | | |
# echo "::add-matcher::.github/sphinx.json" | |
# make doctest SPHINXOPTS="-W --keep-going" | |
codecov: | |
name: Code coverage on codecov | |
runs-on: "macos-latest" | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install requirements | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: .github/environment.yml | |
cache-environment-key: pylatest-macos-latest-mamba-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | |
cache-downloads: false | |
- name: Python version | |
run: python --version | |
- name: Install pyleco extras | |
run: pip install -e .[gui,dev,tests] # editable for covtest | |
- name: Test for Coverage | |
run: pytest --cov=pyleco_extras --cov-report=xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
files: ./coverage.xml,!./cache | |
flags: unittests | |
name: codecov-umbrella | |
verbose: true | |
type_checking: | |
name: Static Type Checking | |
runs-on: "ubuntu-latest" | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install requirements | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: .github/environment.yml | |
cache-environment-key: pylatest-ubuntu-latest-mamba-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | |
cache-downloads: false | |
- name: Python version | |
run: python --version | |
- name: Install pyleco extras | |
run: pip install . | |
- name: Install mypy | |
run: pip install mypy | |
- name: Run mypy | |
run: mypy pyleco_extras tests | |
test: | |
name: Python ${{ matrix.python-version }}, ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: ["macos-latest", "windows-latest"] # ubuntu-latest | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install requirements | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: .github/environment.yml | |
create-args: python=${{ matrix.python-version }} | |
cache-environment-key: py${{ matrix.python-version }}-${{ matrix.os }}-mamba-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | |
cache-downloads: false | |
- name: Python version | |
run: python --version | |
- name: Install pyleco extras | |
run: pip install -e .[gui,dev,tests] # editable for covtest | |
- name: Run pytest under Linux with xvfb | |
if: runner.os == 'Linux' | |
run: | | |
echo "::add-matcher::.github/pytest.json" | |
xvfb-run -a pytest | |
- name: Run pytest under Windows | |
if: runner.os == 'Windows' | |
run: | | |
echo "::add-matcher::.github/pytest.json" | |
pytest | |
- name: Run pytest under Mac without acceptance tests | |
if: runner.os == 'macOS' | |
run: | | |
echo "::add-matcher::.github/pytest.json" | |
pytest --ignore=tests/acceptance_tests |