-
Notifications
You must be signed in to change notification settings - Fork 23
113 lines (100 loc) · 3.05 KB
/
sdk.yaml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: sdk
on:
# Automatically run CI on Release and Pre-Release tags and main branch
# (only if there are changes to relevant paths)
push:
tags:
- "sdk/v[0-9]+.[0-9]+.[0-9]+*"
branches:
- main
paths:
- ".github/workflows/sdk.yaml"
- "sdk/**"
# Automatically run CI on branches, that have active PR opened
pull_request:
branches:
- main
paths:
- ".github/workflows/sdk.yaml"
- "sdk/**"
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
defaults:
run:
working-directory: ./sdk
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
sdk/requirements.txt
sdk/requirements.dev.txt
engines/pyfunc-ensembler-service/requirements.dev.txt
- name: Install dependencies
run: make setup
- name: Run unit tests
run: make test
- uses: codecov/codecov-action@v4
with:
flags: sdk-test-${{ matrix.python-version }}
name: sdk-test-${{ matrix.python-version }}
token: ${{ secrets.CODECOV_TOKEN }}
codecov_yml_path: ./.github/workflows/codecov-config/codecov.yml
release-rules:
runs-on: ubuntu-latest
outputs:
release-type: ${{ steps.release-rules.outputs.release-type }}
steps:
- uses: actions/checkout@v4
- id: release-rules
uses: ./.github/actions/release-rules
with:
prefix: sdk/
publish:
# Automatically publish release and pre-release artifacts.
#
# Dev builds can be released from the 'main' branch by
# approving 'deployment' into the 'manual' environment
if: >-
contains('release,pre-release', needs.release-rules.outputs.release-type)
|| ( github.event_name != 'pull_request' )
|| ( github.event.pull_request.head.repo.full_name == github.repository )
runs-on: ubuntu-latest
needs:
- release-rules
- test
environment: ${{ needs.release-rules.outputs.release-type == 'dev' && 'manual' || '' }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
# fetch full history for a proper version number assignment
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.8
cache: pip
cache-dependency-path: |
sdk/requirements.txt
sdk/requirements.dev.txt
engines/pyfunc-ensembler-service/requirements.dev.txt
- name: Build
working-directory: ./sdk
run: |
make setup
make build
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: sdk/dist