From 7d3fd1079d3c6985f6ea7ba1d2e26c93fe34cab0 Mon Sep 17 00:00:00 2001 From: Joe Flack Date: Mon, 11 Nov 2024 18:52:00 -0500 Subject: [PATCH] GH action: Finished setting up GH action to run subset pipeline and tests - Updated the GH action workflow that does build & tests: - download inputs - download robot.jar - Add: Docs - Bug fix: Tests: Corrected the robot.jar command --- .github/workflows/main.yaml | 49 ++++++++++++++++++++++++++++++------- README.md | 17 ++++++++++--- test/utils.py | 2 +- 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index a005b73..fd401d2 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -19,20 +19,51 @@ jobs: matrix: python-version: ["3.11"] steps: - # Setup + # Common setup - name: Check out repository uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - - name: Install Poetry + - name: Install package manager uses: snok/install-poetry@v1.3 - - name: Install dependencies & project + - name: Install Python dependencies run: poetry install --no-interaction - # Build - - name: Run test suite - run: poetry run comploinc --fast-run build - # Test - - name: Run test suite - run: poetry run python -m unittest discover + # Download additional non-Python dependencies + - name: Download additional dependencies + run: wget https://github.com/ontodev/robot/releases/latest/download/robot.jar + # Download and extract build sources + - name: Download inputs / sources + run: | + echo "${{ secrets.DL_LINK_ID }}" > env + cat env + ls -las env + echo "${{ secrets.DL_LINK }}" > env + cat env + ls -las env + echo ${{ secrets.DL_LINK_ID }} > env + cat env + ls -las env + echo ${{ secrets.DL_LINK }} > env + cat env + ls -las env +# echo 'https://drive.google.com/uc?export=download&id="{{ secrets.DL_LINK_ID }}' -o confirmation.html +# echo "https://drive.usercontent.google.com/download?id="{{ secrets.DL_LINK_ID }}&export=download&confirm=t" -o build-sources.zip +# echo 'https://drive.google.com/uc?export=download&id="${{ secrets.DL_LINK_ID }}"' -o confirmation.html +# echo "https://drive.usercontent.google.com/download?id="${{ secrets.DL_LINK_ID }}"&export=download&confirm=t" -o build-sources.zip +# echo 'https://drive.google.com/uc?export=download&id="{{ secrets.DL_LINK }}' -o confirmation.html +# echo "https://drive.usercontent.google.com/download?id="{{ secrets.DL_LINK }}&export=download&confirm=t" -o build-sources.zip +# echo 'https://drive.google.com/uc?export=download&id="${{ secrets.DL_LINK }}"' -o confirmation.html +# echo "https://drive.usercontent.google.com/download?id="${{ secrets.DL_LINK }}"&export=download&confirm=t" -o build-sources.zip +# run: | +# curl -L -c cookies.txt 'https://drive.google.com/uc?export=download&id="${{ secrets.DL_LINK_ID }}"' -o confirmation.html +# curl -L -b cookies.txt "https://drive.usercontent.google.com/download?id="${{ secrets.DL_LINK_ID }}"&export=download&confirm=t" -o build-sources.zip +# unzip build-sources.zip +# rm build-sources.zip cookies.txt confirmation.html +# # Build +# - name: Build +# run: poetry run comploinc --fast-run build +# # Test +# - name: Run test suite +# run: poetry run python -m unittest discover diff --git a/README.md b/README.md index b2e5bfb..174c913 100644 --- a/README.md +++ b/README.md @@ -75,15 +75,26 @@ See: `comploinc_config.yaml` If following the setup exactly, this configuration will not need to be modified. -## Tests +## Developer docs
Details -### Tests: prerequisites +### Tests +#### Tests: prerequisites 1. [`robot`](https://robot.obolibrary.org/) 2. Files in `output/build-default/fast-run/` - Can populate via `comploinc --fast-run build default` -### Tests: Running +#### Tests: Running `python -m unittest discover` +### Standard operating procedures (SOPs) +#### Setting up new/updated inputs/sources +1. Create a new `YYYY-MM-DD_comploinc-build-sources.zip` in the [Google Drive folder]( +https://drive.google.com/drive/folders/1Ae5NX959S_CV60nbf9N_37Ao-wJzM0fh). Ensure it has the correct structure (folder +names and files at the right paths). +2. Make the link public: In the Google Drive folder, right-click the file, select "Share", and click "Share." At the +bottom, under "General Access", click the left dropdown and select "Anyone with the link." Click "Copy link". +3. Update `DL_LINK_ID` in GitHub: Go to the [page](https://github.com/loinc/comp-loinc/settings/secrets/actions/DL_LINK_ID) +for updating it. Paste the link from the previous step into the box, and click "Update secret." +
diff --git a/test/utils.py b/test/utils.py index f4f8330..f6027c1 100644 --- a/test/utils.py +++ b/test/utils.py @@ -12,7 +12,7 @@ except ModuleNotFoundError: from config import ROBOT_JAR_PATH, TEST_IN_DIR, TEST_OUT_DIR, TEST_SPARQL_QEURY_DIR -robot_cmd_options = ['robot', ROBOT_JAR_PATH] +robot_cmd_options = ['robot', f'java -jar {ROBOT_JAR_PATH}'] def _get_paths(onto_filename: str, sparql_filename: str) -> tuple[str, str, str]: