-
Notifications
You must be signed in to change notification settings - Fork 399
147 lines (125 loc) · 3.72 KB
/
argilla.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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Build Argilla package
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
workflow_call:
push:
tags:
- "*"
branches:
- main
- develop
- "feat/**"
- releases/**
pull_request:
paths:
- "argilla/**"
types:
- opened
- edited
- reopened
- synchronize
- ready_for_review
release:
types:
- "published"
jobs:
run_unit_tests:
name: Run unit tests
uses: ./.github/workflows/argilla.run-python-tests.yml
with:
coverageReport: coverage
runsOn: extended-runner
pytestArgs: tests/unit
secrets: inherit
run_end2end_tests:
strategy:
matrix:
include:
- searchEngineDockerImage: docker.elastic.co/elasticsearch/elasticsearch:8.8.2
searchEngineDockerEnv: '{"discovery.type": "single-node", "xpack.security.enabled": "false"}'
runsOn: extended-runner
name: Run end2end tests
uses: ./.github/workflows/argilla.end2end-examples.yml
with:
runsOn: ${{ matrix.runsOn }}
searchEngineDockerImage: ${{ matrix.searchEngineDockerImage }}
searchEngineDockerEnv: ${{ matrix.searchEngineDockerEnv }}
secrets: inherit
run_integration_tests:
name: Run integration tests
uses: ./.github/workflows/argilla.run-python-tests.yml
needs:
- run_unit_tests
with:
runsOn: extended-runner
coverageReport: coverage-extra
pytestArgs: tests/integration
secrets: inherit
push_coverage:
name: Upload code coverage
runs-on: ubuntu-latest
needs:
- run_unit_tests
- run_integration_tests
defaults:
run:
shell: bash -l {0}
working-directory: argilla
steps:
- name: Checkout Code 🛎
uses: actions/checkout@v4
- name: Download coverage reports
uses: actions/download-artifact@v3
with:
path: argilla/coverage-report
- name: Copy all reports
run: find coverage-report/ -name "*.xml" -exec mv '{}' . \;
- name: Upload Coverage reports to Codecov 📦
uses: codecov/codecov-action@v2
with:
flags: argilla
token: ${{ secrets.CODECOV_TOKEN }}
build_python_package:
name: Build Argilla python package
uses: ./.github/workflows/argilla.build-python-package.yml
needs:
- run_unit_tests
- run_integration_tests
secrets: inherit
# This job will upload a Python Package using Twine when a release is created
# For more information see:
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
publish_release:
name: Publish Release
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
needs:
- run_integration_tests
defaults:
run:
shell: bash -l {0}
working-directory: argilla
steps:
- name: Checkout Code 🛎
uses: actions/checkout@v4
- name: Download python package
uses: actions/download-artifact@v4
with:
name: argilla
path: dist
- name: Publish Package to TestPyPI 🥪
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.AR_TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Test Installing 🍿
run: pip install --index-url https://test.pypi.org/simple --no-deps argilla==${GITHUB_REF#refs/*/v}
- name: Publish Package to PyPI 🥩
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.AR_PYPI_API_TOKEN }}