-
Notifications
You must be signed in to change notification settings - Fork 23
113 lines (100 loc) · 3.51 KB
/
pyfunc-ensembler-service.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: engines/pyfunc-ensembler-service
on:
# Automatically run CI on Release and Pre-Release tags and main branch
# (only if there are changes to relevant paths)
push:
tags:
- "pyfunc-ensembler-service/v[0-9]+.[0-9]+.[0-9]+*"
branches:
- main
paths:
- ".github/workflows/pyfunc-ensembler-service.yaml"
- "engines/pyfunc-ensembler-service/**"
- "sdk/**"
# Automatically run CI on branches, that have active PR opened
pull_request:
branches:
- main
paths:
- ".github/workflows/pyfunc-ensembler-service.yaml"
- "engines/pyfunc-ensembler-service/**"
- "sdk/**"
# To make it possible to trigger e2e CI workflow for any arbitrary git ref
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache-dependency-path: |
engines/pyfunc-ensembler-service/env-${{ matrix.python-version }}.yaml
engines/pyfunc-ensembler-service/requirements.txt
engines/pyfunc-ensembler-service/requirements.dev.txt
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
- name: Run Tests
working-directory: engines/pyfunc-ensembler-service
run: |
make setup
make test
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: pyfunc-ensembler-service/
publish:
# Automatically publish release and pre-release artifacts.
#
# As for dev releases, make it possible to publish artifacts
# manually by approving 'deployment' in the 'manual' environment.
#
# Dev build can be released either from the 'main' branch or
# by running this workflow manually with `workflow_dispatch` event.
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 )
environment: ${{ needs.release-rules.outputs.release-type == 'dev' && 'manual' || '' }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
needs:
- release-rules
- test
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker Image
id: build
working-directory: engines/pyfunc-ensembler-service
env:
DOCKER_REGISTRY: ghcr.io/${{ github.repository }}
PYTHON_VERSION: ${{ matrix.python-version }}
run: |
set -o pipefail
make build-image | tee output.log
echo "::set-output name=pyfunc-ensembler-service-image::$(sed -n 's%Building docker image: \(.*\)%\1%p' output.log)"
- name: Publish Pyfunc Ensembler Service Docker Image
run: docker push ${{ steps.build.outputs.pyfunc-ensembler-service-image }}