added tests #1
Workflow file for this run
This file contains hidden or 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: Pull requests tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.12" | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 pytest | |
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
- name: Run linting | |
run: | | |
pre-commit run -a | |
- name: Test with pytest | |
run: | | |
pytest -n auto -v --capture=sys -x --tb=long --junitxml=/tmp/test-results/openstack-peepo-exporter-unittests.xml | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: openstack-peepo-exporter-unittests | |
path: /tmp/test-results/openstack-peepo-exporter-unittests.xml |