Skip to content

Addition of Test and Automatic Setup #1

Addition of Test and Automatic Setup

Addition of Test and Automatic Setup #1

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Testing pyforce
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: "3.10"
channels: conda-forge
use-mamba: true # Optional: to speed up the environment solving
- name: Create Conda environment
run: |
conda env create -f pyforce/environment.yml
- name: Activate Conda environment
run: |
conda activate pyforce-env
python -m pip install pytest
python -m pip install pyforce/
shell: bash -l {0}
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
conda init
conda activate pyforce-env
pytest
shell: bash -l {0}