add gh action to run unittests #19
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: Run Tests | |
on: | |
pull_request: | |
branches: | |
- main # Runs on pull requests targeting the main branch | |
jobs: | |
tests: | |
name: Test (${{ matrix.python-version }}, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
python-version: ["3.11"] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: condaenv | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge | |
# - name: Create conda environment | |
# run: conda env create --name condaenv | |
# - name: Activate conda environment | |
# run: conda activate condaenv | |
- name: Install cadquery | |
run: conda install -c conda-forge cadquery | |
- name: Install pip dependencies | |
run: pip install cqkit pytest | |
- name: Install package | |
run: pip install . | |
- name: Run tests | |
run: pytest tests |