Skip to content

Commit

Permalink
first attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
ywkim312 committed Aug 8, 2023
1 parent 295dd5a commit e4ec239
Showing 1 changed file with 36 additions and 13 deletions.
49 changes: 36 additions & 13 deletions .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ jobs:
# ----------------------------------------------------------------------
unit-test:
runs-on: ubuntu-latest
strategy:
matrix:
vars: [ { python-version: '3.8', sleep: '0s' }, { python-version: '3.9', sleep: '60s' },
{ python-version: '3.10', sleep: '120s' }, { python-version: '3.11', sleep: '180s' } ]
name: Python ${{ matrix.vars.python-version }} Test
steps:
- name: Checkout source code
uses: actions/checkout@v2
Expand All @@ -28,25 +33,43 @@ jobs:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{
hashFiles('environment.yml') }}

- name: Install miniconda
uses: conda-incubator/setup-miniconda@v2
- name: Install micromamba
uses: mamba-org/setup-micromamba@v1
with:
miniconda-version: "latest"
mamba-version: "*"
use-mamba: true
python-version: 3.8
activate-environment: base
channels: conda-forge,in-core
environment-file: environment.yml
use-only-tar-bz2: true
conda-build-version: "*"
create-args: >-
python=${{ matrix.vars.python-version }}
pytest
environment-file: environment.yml
generate-run-shell: true
# miniconda-version: "latest"
# mamba-version: "*"
# use-mamba: true
# python-version: 3.8
# activate-environment: base
# channels: conda-forge,in-core
# environment-file: environment.yml
# use-only-tar-bz2: true
# conda-build-version: "*"

- name: Sleep for ${{ matrix.vars.sleep }} to avoid multiple pytests run concurrently
uses: jakejarvis/wait-action@master
with:
time: ${{ matrix.vars.sleep }}

- name: Run pyincore viz tests with pytest
run: |
echo "${{secrets.PYTEST_USER_TOKEN}}" > tests/pyincore_viz/.incorepw
$CONDA/bin/pytest --cache-clear -s tests/pyincore_viz/test_pyincore_viz.py --junitxml=test-reports/viz_results.xml
python -m pytest tests/pyincore_viz/test_pyincore_viz.py
shell: micromamba-shell {0}
# run: |
# echo "${{secrets.PYTEST_USER_TOKEN}}" > tests/pyincore_viz/.incorepw
# $CONDA/bin/pytest --cache-clear -s tests/pyincore_viz/test_pyincore_viz.py --junitxml=test-reports/viz_results.xml

- name: Run analysis viz tests with pytest
run: |
echo "${{secrets.PYTEST_USER_TOKEN}}" > tests/pyincore_viz/.incorepw
$CONDA/bin/pytest --cache-clear -s tests/pyincore_viz/test_analysis_viz.py --junitxml=test-reports/analysis_results.xml
python -m pytest tests/pyincore_viz/test_analysis_viz.py
shell: micromamba-shell {0}
# run: |
# echo "${{secrets.PYTEST_USER_TOKEN}}" > tests/pyincore_viz/.incorepw
# $CONDA/bin/pytest --cache-clear -s tests/pyincore_viz/test_analysis_viz.py --junitxml=test-reports/analysis_results.xml

0 comments on commit e4ec239

Please sign in to comment.