Repo Restructuring (#10) #60
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: Tests | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "flexynesis/**" | |
- "tests/**" | |
- "pyproject.toml" | |
- "spec-file.txt" | |
- ".github/workflows/tests.yml" | |
pull_request: | |
paths: | |
- "flexynesis/**" | |
- "tests/**" | |
- "pyproject.toml" | |
- "spec-file.txt" | |
- ".github/workflows/tests.yml" | |
jobs: | |
unit-tests: | |
name: Run Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.9" | |
- name: Set up Miniconda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: "3.9" | |
- name: Cache Conda environment | |
uses: actions/cache@v2 | |
with: | |
path: ~/miniconda/envs | |
key: ${{ runner.os }}-conda-${{ hashFiles('spec-file.txt') }} | |
restore-keys: | | |
${{ runner.os }}-conda- | |
- name: Create environment with dependencies | |
shell: bash -l {0} | |
run: | | |
conda create --name my_env --file spec-file.txt | |
conda activate my_env | |
pip install pytest | |
- name: Install my package from source | |
shell: bash -l {0} | |
run: | | |
conda activate my_env | |
pip install -e . | |
- name: Run Unit Tests | |
shell: bash -l {0} | |
run: | | |
conda activate my_env | |
pytest -vvv --color=yes tests/unit |