Merge pull request #171 from QCoDeS/dependabot/github_actions/crazy-m… #1
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: Run mypy and pytest | |
on: | |
push: | |
branches: | |
- 'master' | |
- 'release/*' | |
- 'staging' | |
- 'trying' | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
pytestmypy: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ["3.8", "3.9", "3.10"] | |
exclude: | |
- os: windows-latest | |
python-version: "3.9" | |
- os: windows-latest | |
python-version: "3.10" | |
env: | |
DISPLAY: ':99.0' | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v3.1.0 | |
with: | |
submodules: true | |
- name: setup ubuntu-latest xvfb | |
uses: ./.github/actions/setup-ubuntu-latest-xvfb | |
if: runner.os == 'Linux' | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4.3.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: prepare pip cache | |
id: prepare-cache-pip | |
uses: ./.github/actions/prepare-cache-pip | |
- name: pip cache | |
uses: actions/cache@v3.0.11 | |
with: | |
path: ${{ steps.prepare-cache-pip.outputs.cache-dir }} | |
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/setup.cfg') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.python-version }}-pip- | |
- name: install package | |
run: | | |
pip install .[test] -c requirements.txt | |
- name: Run Mypy | |
run: mypy qcodes_contrib_drivers | |
- name: Run tests | |
run: | | |
pytest --cov=qcodes_contrib_drivers --cov-report xml --cov-config=setup.cfg qcodes_contrib_drivers | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3.1.1 | |
with: | |
file: ./coverage.xml | |
env_vars: OS,PYTHON |