-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (62 loc) · 1.81 KB
/
python-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# 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/