Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 7 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,41 +7,14 @@ on:
permissions: {}

jobs:
pytest:
name: pytest
test:
name: Test
strategy:
matrix:
python-version: ["3.11", "3.12"]
runs-on: ubuntu-latest
permissions:
contents: read # Required to checkout the repository.
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Install the package in editable mode so tests can import the package
pip install -e .
pip install pytest pytest-cov
# Ensure msal is available for the auth module
pip install msal

- name: Run pytest
run: pytest tests/ --doctest-modules --junitxml=junit/test-results.xml

- name: Upload artifact
# Always run this step to upload test results when there are test failures
if: always()
uses: actions/upload-artifact@v5
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results.xml
contents: read
uses: equinor/ops-actions/.github/workflows/python.yml@feat/python/run-pytest
with:
python_version: ${{ matrix.python-version }}
requirements: "."
Loading