181 update GitHub action version (#192) #288
Workflow file for this run
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
name: PYTEST | |
on: | |
push: | |
env: | |
MAIN_REPO: IN-CORE/pyincore-viz | |
jobs: | |
#----------------------------------------------------------------------- | |
# UNIT TEST | |
# ---------------------------------------------------------------------- | |
unit-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
vars: [ { python-version: '3.9', sleep: '0s' }, { python-version: '3.10', sleep: '60s' }, | |
{ python-version: '3.11', sleep: '120s' }, { python-version: '3.12', sleep: '180s' } ] | |
name: Python ${{ matrix.vars.python-version }} Test | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v2 | |
- name: Cache conda | |
uses: actions/cache@v2 | |
env: | |
# Increase this value to reset cache if environment.yml has not changed | |
CACHE_NUMBER: 0 | |
with: | |
path: ~/conda_pkgs_dir | |
key: | |
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ | |
hashFiles('environment.yml') }} | |
- name: Install micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
create-args: >- | |
python=${{ matrix.vars.python-version }} | |
pytest | |
environment-file: environment.yml | |
generate-run-shell: true | |
- 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 | |
python -m pytest tests/pyincore_viz/test_pyincore_viz.py | |
shell: micromamba-shell {0} | |
- name: Run analysis viz tests with pytest | |
run: | | |
echo "${{secrets.PYTEST_USER_TOKEN}}" > tests/pyincore_viz/.incorepw | |
python -m pytest tests/pyincore_viz/test_analysis_viz.py | |
shell: micromamba-shell {0} |