-
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 #21 from crim-ca/DAC-524-baseline-V2
Completes implementation part of https://crim-ca.atlassian.net/browse/DAC-551 Ready for rebuild of docker image and deployment.
- Loading branch information
Showing
107 changed files
with
109,952 additions
and
2,444 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,106 @@ | ||
# run test suites | ||
|
||
name: Tests | ||
on: | ||
- pull_request | ||
- push | ||
|
||
jobs: | ||
# see: https://github.com/fkirc/skip-duplicate-actions | ||
skip_duplicate: | ||
continue-on-error: true | ||
runs-on: ubuntu-latest | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
uses: fkirc/skip-duplicate-actions@master | ||
with: | ||
concurrent_skipping: "same_content" | ||
skip_after_successful_duplicate: "true" | ||
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' | ||
|
||
# NOTE: | ||
# Run all the steps even if there are no tests defined for a given domain sub-directory. | ||
# This is to make sure that the environment definition is at the very least buildable. | ||
tests: | ||
needs: skip_duplicate | ||
if: ${{ needs.skip_duplicate.outputs.should_skip != 'true' }} | ||
runs-on: ${{ matrix.os }} | ||
continue-on-error: ${{ matrix.allow-failure }} | ||
env: | ||
CACHE_NUMBER: 0 # increment to reset cache | ||
|
||
# ensure conda env activation is performed automatically | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
# somehow mamba with python 3.12 doesn't resolve spacy although available... | ||
python-version: ["3.9", "3.10", "3.11"] | ||
allow-failure: [false] | ||
domain: ["eo", "nlp"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: "0" | ||
|
||
- name: Setup Mamba | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
miniforge-variant: Mambaforge | ||
miniforge-version: latest | ||
activate-environment: github-ci-test-python${{ matrix.python-version }}-${{ matrix.domain }} | ||
use-mamba: true | ||
use-only-tar-bz2: true | ||
|
||
- name: Set cache date | ||
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | ||
|
||
- uses: actions/cache@v2 | ||
id: cache | ||
with: | ||
path: ${{ env.CONDA }}/envs/github-ci-test-python${{ matrix.python-version }}-${{ matrix.domain }} | ||
key: conda-python${{ matrix.python-version }}-${{ matrix.domain }}-${{ hashFiles('${{ matrix.domain }}/environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} | ||
|
||
- name: Display Python | ||
run: which python | ||
|
||
- name: Update environment | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
echo "python=${{ matrix.python-version }}" > ${{ env.CONDA }}/envs/github-ci-test-python${{ matrix.python-version }}-${{ matrix.domain }}/conda-meta/pinned | ||
mamba env update \ | ||
-n github-ci-test-python${{ matrix.python-version }}-${{ matrix.domain }} \ | ||
-f ${{ matrix.domain }}/environment.yml | ||
- name: Display Packages | ||
if: ${{ matrix.python-version != 'none' }} | ||
run: pip freeze | ||
|
||
- name: Display Environment Variables | ||
run: | | ||
hash -r | ||
env | sort | ||
- name: Check Tests | ||
id: check_tests | ||
run: | | ||
echo "HAS_TEST_DIR=$(test -d ${{ matrix.domain }}/tests && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT | ||
- name: Install Tests Dependencies | ||
if: ${{ steps.check_tests.outputs.HAS_TEST_DIR == 'true' }} | ||
run: pip install -r requirements-dev.txt | ||
|
||
- name: Run Tests | ||
if: ${{ steps.check_tests.outputs.HAS_TEST_DIR == 'true' }} | ||
run: | | ||
cd ${{ matrix.domain }}/notebooks | ||
python -m pytest -vvv ../tests |
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 |
---|---|---|
@@ -1,8 +1,25 @@ | ||
### IDE | ||
**/.idea/ | ||
**/.vscode/ | ||
**/*.code-workspace | ||
|
||
### Caches | ||
**/__pycache__/ | ||
**/cache/ | ||
**/*tree-tagger-linux* | ||
**/.pytest_cache | ||
**/condaenv.*.requirements.txt | ||
|
||
## Chroma VDB caches | ||
**/*.bin | ||
**/*.pickle | ||
**/*.sqlite3 | ||
|
||
### Binaries | ||
**/*.jar | ||
|
||
### Notebooks | ||
# expect examples per domain | ||
# disallow notebooks at root | ||
./*.ipynb | ||
**/.ipynb_checkpoints/ |
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
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
File renamed without changes.
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
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.