Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor GitHub Actions & Add build-schema Step #417

Merged
merged 11 commits into from
Feb 24, 2025
49 changes: 39 additions & 10 deletions .github/workflows/test_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: '3.9.16'

- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Install package and dependencies
run: |
pip install -r requirements.txt
Expand All @@ -44,9 +46,15 @@ jobs:
strategy:
max-parallel: 3
matrix:
modules: ["read-lab-metadata", "read-bioinfo-metadata", "validate"]
steps:
modules:
- "read-lab-metadata"
- "read-bioinfo-metadata"
- "validate"
- "build-schema"
env:
OUTPUT_LOCATION: ${{ github.workspace }}/tests/

steps:
- name: Set up Python 3.9.16
uses: actions/setup-python@v3
with:
Expand All @@ -63,17 +71,38 @@ jobs:
pip install -r requirements.txt
pip install .

- name: Run each module tests
- name: Run read-lab-metadata module
if: matrix.modules == 'read-lab-metadata'
run: |
relecov-tools read-lab-metadata \
-m tests/data/read_lab_metadata/metadata_lab_test.xlsx \
-s tests/data/read_lab_metadata/samples_data_test.json \
-o $OUTPUT_LOCATION

- name: Run validate module
if: matrix.modules == 'validate'
run: |
relecov-tools validate \
-j tests/data/map_validate/processed_metadata_lab_test.json \
-s relecov_tools/schema/relecov_schema.json \
-m tests/data/map_validate/metadata_lab_test.xlsx \
-o $OUTPUT_LOCATION

- name: Run build-schema module
if: matrix.modules == 'build-schema'
run: |
if [ "${{ matrix.modules }}" == "read-lab-metadata" ]; then
relecov-tools read-lab-metadata -m tests/data/read_lab_metadata/metadata_lab_test.xlsx -s tests/data/read_lab_metadata/samples_data_test.json -o $OUTPUT_LOCATION
elif [ "${{ matrix.modules }}" == "validate" ]; then
relecov-tools validate -j tests/data/map_validate/processed_metadata_lab_test.json -s relecov_tools/schema/relecov_schema.json -m tests/data/map_validate/metadata_lab_test.xlsx -o $OUTPUT_LOCATION
fi
relecov-tools build-schema \
-i tests/data/build_schema/metadata_mapping_file.xlsx \
--version $SCHEMA_DEFAULT_VERSION \
--project $PROJECT_NAME \
--non-interactive \
-o $OUTPUT_LOCATION
env:
OUTPUT_LOCATION: ${{ github.workspace }}/tests/
SCHEMA_DEFAULT_VERSION: "3.0.0"
PROJECT_NAME: "relecov"

- name: Upload output file
uses: actions/upload-artifact@v4
with:
name: test-output
path: output.txt
path: ${{ github.workspace }}/output.txt
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ dmypy.json

# (Ad-hoc files)
.nextflow*

# CI testing stuff
.github/*_event.json
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Code contributions to the release:

#### Added enhancements

- Refactor GitHub Actions & Add build-schema Step [#417](https://github.com/BU-ISCIII/relecov-tools/pull/417)
- Add documentation for `bioinfo_config.json` in README [#415](https://github.com/BU-ISCIII/relecov-tools/pull/415)
- Added a more robust datatype handling in utils.py read_csv_file_return_dict() method [#379](https://github.com/BU-ISCIII/relecov-tools/pull/379)
- Improved relecov template generator and version control [#382](https://github.com/BU-ISCIII/relecov-tools/pull/382)
Expand Down
Binary file not shown.
Loading