forked from nasa/harmony-SMAP-L2-gridding-service
-
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.
Merge pull request #6 from flamingbear/mhs/DAS-2267/implement-GitHub-…
…actions-ci DAS-2267: Add CI config for testing and reporting.
- Loading branch information
Showing
3 changed files
with
77 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,34 @@ | ||
# This workflow will run the appropriate library tests across a python matrix of versions. | ||
name: Run Python library tests | ||
|
||
on: | ||
workflow_call | ||
|
||
jobs: | ||
build_and_test_lib: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.10', '3.11', '3.12'] | ||
|
||
steps: | ||
- name: Checkout smap-l2-gridder repository | ||
uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
pip install -r pip_requirements.txt -r tests/pip_test_requirements.txt | ||
- name: Run science tests while excluding the service tests. | ||
run: | | ||
pytest tests --ignore tests/test_service |
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,37 @@ | ||
# This workflow will build the service and test Docker images for smap-l2-gridder, | ||
# then run the `pytest` suite within a test Docker container, reporting | ||
# test results and code coverage as artefacts. It will be called by the | ||
# workflow that run tests against new PRs and as a first step in the workflow | ||
# that publishes new Docker images. | ||
|
||
name: Run Python Service Tests | ||
|
||
on: | ||
workflow_call | ||
|
||
jobs: | ||
build_and_test_service: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout smap-l2-gridder repository | ||
uses: actions/checkout@v4 | ||
with: | ||
lfs: true | ||
|
||
- name: Build service image | ||
run: ./bin/build-image | ||
|
||
- name: Build test image | ||
run: ./bin/build-test | ||
|
||
- name: Run test image | ||
run: ./bin/run-test | ||
|
||
- name: Archive test results and coverage | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: reports | ||
path: reports/**/* |
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