Skip to content

Commit

Permalink
GH action: Finished setting up GH action to run subset pipeline and t…
Browse files Browse the repository at this point in the history
…ests

- Updated the GH action workflow that does build & tests:
  - download inputs
  - download robot.jar
- Add: Docs
- Bug fix: Tests: Corrected the robot.jar command
  • Loading branch information
joeflack4 committed Dec 9, 2024
1 parent d59ec80 commit 7d3fd10
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 13 deletions.
49 changes: 40 additions & 9 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
- 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
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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><summary>Details</summary>

### 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."

</details>
2 changes: 1 addition & 1 deletion test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit 7d3fd10

Please sign in to comment.