Skip to content

Commit

Permalink
update pytest actions
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestfwilliams committed Apr 19, 2024
1 parent 7762b39 commit 426bf14
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pytest-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Integration Test

on:
pull_request:
branches:
- main

jobs:
call-pytest-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: forrestfwilliams/burst2safe/.github/workflows/reusable-pytest.yml
with:
local_package_name: burst2safe
additional_args: -m integration
4 changes: 1 addition & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ on:
jobs:
call-pytest-workflow:
# Docs: https://github.com/ASFHyP3/actions
uses: ASFHyP3/actions/.github/workflows/reusable-pytest.yml@v0.11.0
uses: forrestfwilliams/burst2safe/.github/workflows/reusable-pytest.yml
with:
local_package_name: burst2safe
python_versions: >-
["3.10", "3.11", "3.12"]
40 changes: 40 additions & 0 deletions .github/workflows/reusable-pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
workflow_call:
inputs:
local_package_name:
required: true
type: string
python_versions:
required: false
default: >-
["3.10", "3.11", "3.12"]
description: JSON string containing the list of python versions to test
type: string
additional_args:
required: false
type: string
description: Additional arguments to pass to pytest as string
default: ""

jobs:
pytest:
runs-on: ubuntu-latest

strategy:
matrix:
python_version: ${{ fromJson(inputs.python_versions) }}

steps:
- uses: actions/checkout@v4

- uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
create-args: >-
python=${{ matrix.python_version }}
- name: Pytest in conda environment
shell: bash -l {0}
run: |
python -m pip install --no-deps .
pytest --cov=${{ inputs.local_package_name }} ${{ inputs.pytest_args }}

0 comments on commit 426bf14

Please sign in to comment.