Merge branch 'main' into develop #53
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
# This workflow will install Python dependencies, run tests, and build distribution artifacts with Poetry | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CPM test and build | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
schedule: | |
- cron: '0 10 5 * *' | |
jobs: | |
coverage: | |
name: Run CPM tests and publish test coverage | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout code | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Configure Poetry | |
run: | | |
poetry config virtualenvs.create false | |
- name: Install dependencies | |
run: | | |
pip install --upgrade poetry | |
poetry install --verbose | |
- name: Test with pytest | |
run: | | |
export PYTHONPATH=$(pwd) | |
poetry run pytest ./tests --cov=./cpm_python --full-trace | |
build: | |
name: Build distribution | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v3 | |
name: Checkout code | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Configure Poetry | |
run: | | |
poetry config virtualenvs.create false # Use the system environment | |
- name: Install dependencies | |
run: | | |
poetry install | |
- name: Build distribution | |
run: | | |
poetry build --no-interaction | |
- name: List built artifacts | |
run: ls -al dist/ |