-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (47 loc) · 1.54 KB
/
ci-test.yml
File metadata and controls
60 lines (47 loc) · 1.54 KB
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
##
## Copyright (c) 2022-2023 Geosiris.
## SPDX-License-Identifier: Apache-2.0
##
name: Tests
on:
workflow_dispatch:
env:
GENERATED_CODE_FOLDER: etptypes
jobs:
unit-tests:
name: Unit tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"] #, "3.10"
steps:
- uses: actions/checkout@v4
- name: Generate code from avro-to-python-etp
uses: ./.github/actions/generate
with:
python-version: ${{ matrix.python-version }}
dest-folder: ${{ env.GENERATED_CODE_FOLDER }}
etp-file-name: ${{ secrets.ETP_FILE_NAME }}
- name: Install dependencies
uses: ./.github/actions/prepare-poetry
with:
python-version: ${{ matrix.python-version }}
toml-path: ${{ env.GENERATED_CODE_FOLDER }}
- name: Run pytest
run: |
cd ${{ env.GENERATED_CODE_FOLDER }}
poetry add -D pytest
poetry run pytest --cov=etptypes --cov-report=xml --junitxml=pytest.xml
shell: bash
- name: Upload pytest artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: Unit Test Results (Python ${{ matrix.python-version }})
path: ${{ env.GENERATED_CODE_FOLDER }}/pytest.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ env.GENERATED_CODE_FOLDER }}/coverage.xml
fail_ci_if_error: true