-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
create automated testing workflows
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Run Tests and Report Results | ||
description: Set up the Conda environment and run tests using pytest. | ||
|
||
inputs: | ||
environment-file: | ||
description: The Conda environment file to use. | ||
required: true | ||
default: environment.yml | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Set up Conda | ||
uses: ../setup-conda # Use the setup-conda action from your repo | ||
with: | ||
environment-file: ${{ inputs.environment-file }} | ||
|
||
- name: Run pytest | ||
run: | | ||
conda run -n test pytest | ||
shell: bash -el {0} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Run Tests | ||
|
||
env: | ||
ENV_FILE: environment.yml | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Activate Conda Environment | ||
uses: ./.github/actions/setup-conda | ||
with: | ||
environment-file: ${{ env.ENV_FILE }} | ||
|
||
- name: Run pytest | ||
run: | | ||
conda run -n test pytest --junitxml=test-data.xml | ||
shell: bash -el {0} | ||
|
||
- name: Publish Test Results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Test results | ||
path: test-data.xml |