conda for CI testing v3 #39
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: ci-python-test | |
# Define the events that trigger the workflow | |
on: | |
push: | |
branches: | |
- '*' | |
workflow_dispatch: | |
# Define the jobs in the workflow | |
jobs: | |
python-test: | |
# Define the type of runner to use | |
runs-on: ubuntu-latest | |
# Define strategy for matrix builds | |
strategy: | |
matrix: | |
# You can change the default value as needed | |
python-version: ['3.8', '3.9', '3.10'] | |
steps: | |
# Step: Check out the repository's code to the runner | |
- name: checkout-code | |
uses: actions/checkout@v3 | |
# Step: Set up Python environment | |
- name: setup-python-env ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Step: Install project dependencies using pip | |
- name: install-dependencies | |
# run: | | |
# python -m pip install --upgrade pip setuptools wheel | |
# python -m pip install . | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: anaconda-client-env | |
environment-file: etc/example-environment.yml | |
python-version: ${{ matrix.python-version }} | |
auto-activate-base: false | |
# Step: List installed packages | |
- name: list-packages | |
# run: pip list | |
run: | | |
conda info | |
conda list | |
# Step: Run tests with Pytest | |
- name: run-tests | |
run: python -m pytest |