-
Notifications
You must be signed in to change notification settings - Fork 12
77 lines (65 loc) · 1.88 KB
/
gpCAM-CI.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
68
69
70
71
72
73
74
75
76
77
name: gpCAM CI
on:
push:
branches: [ master ]
tags:
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m ensurepip --upgrade
python -m pip install --upgrade setuptools
pip install -e .[tests]
- name: Run tests
run: pytest tests --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
env_vars: OS, PYTHON
fail_ci_if_error: true
files: ./coverage.xml
name: codecov-umbrella
verbose: true
deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Setup deploy
run: |
python -m ensurepip --upgrade
python -m pip install --upgrade setuptools
pip install --upgrade wheel twine hatch
hatch build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
- name: Github Release
uses: fnkr/github-action-ghr@v1
env:
GHR_COMPRESS: xz
GHR_PATH: dist/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}