generated from EED-Solutions/eed_package_template
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (90 loc) · 3.4 KB
/
ci.yml
File metadata and controls
94 lines (90 loc) · 3.4 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
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
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
lint:
name: Run Ruff
runs-on: ubuntu-latest
steps:
- name: "checkout repository"
uses: EED-Solutions/eed_gha_workflows/.github/actions/checkout_code@main
- name: ruff
uses: EED-Solutions/eed_gha_workflows/.github/actions/ruff@main
with:
checkout_code: false
generate-parameters:
runs-on: ubuntu-latest
name: generate parameters
outputs:
matrix: ${{ steps.set_matrix.outputs.matrix }}
steps:
- name: install duckdb
uses: EED-Solutions/eed_gha_workflows/.github/actions/install_duckdb@main
- name: checkout_gha_workflows
uses: EED-Solutions/eed_gha_workflows/.github/actions/checkout_code@main
with:
repository: EED-Solutions/eed_gha_workflows
ref: main # change for development purposes
path: config
sparse-checkout: |
.github/actions/pytests/.python-versions
- name: Debug - List files
run: |
find config -type f | sort
- name: Get Python Version for pytests
id: get_python_version
run: |
python_versions=$(duckdb -csv -noheader -c "SELECT JSON_GROUP_ARRAY(column0) FROM READ_CSV('config/.github/actions/pytests/.python-versions', HEADER=FALSE, ALL_VARCHAR=TRUE)") # ["3.12", "3.13"]
echo "python_versions=$python_versions" >> $GITHUB_OUTPUT
echo "Python version for tests: ${python_versions}"
- name: Set up matrix for pytests
id: set_matrix
run: |
python_versions=${{ steps.get_python_version.outputs.python_versions }}
matrix_json="{\"python-version\": $python_versions}"
echo "matrix=$matrix_json" >> $GITHUB_OUTPUT
echo "matrix=$matrix_json"
pytests:
name: Run Pytests
runs-on: ubuntu-latest
needs: generate-parameters
strategy:
matrix: ${{ fromJson(needs.generate-parameters.outputs.matrix) }}
steps:
- name: "checkout repository"
uses: EED-Solutions/eed_gha_workflows/.github/actions/checkout_code@main
- name: "install uv and python"
uses: EED-Solutions/eed_gha_workflows/.github/actions/install_uv@main
with:
python-version: ${{ matrix.python-version }}
version-file: ''
- name: set up python environment
uses: EED-Solutions/eed_gha_workflows/.github/actions/set_up_py_env@main
- name: pytests
uses: EED-Solutions/eed_gha_workflows/.github/actions/pytests@main
with:
checkout_code: false
install_uv: false
install_dependencies: false
pytests_cov:
name: Run Pytests with Coverage
runs-on: ubuntu-latest
needs: generate-parameters
steps:
- name: "checkout repository"
uses: EED-Solutions/eed_gha_workflows/.github/actions/checkout_code@main
- name: "install uv and python"
uses: EED-Solutions/eed_gha_workflows/.github/actions/install_uv@main
- name: set up python environment
uses: EED-Solutions/eed_gha_workflows/.github/actions/set_up_py_env@main
- name: pytests with coverage
uses: EED-Solutions/eed_gha_workflows/.github/actions/pytests_cov@main
with:
checkout_code: false
install_uv: false
install_dependencies: false
fail-under: 80