-
Notifications
You must be signed in to change notification settings - Fork 22
99 lines (98 loc) · 3.24 KB
/
ci.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
---
name: CI
on:
workflow_call: # yamllint disable-line rule:truthy
outputs:
version:
description: 'The version of the package'
value: ${{ jobs.version.outputs.version }}
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set-version.outputs.GITVERSION_SEMVER }}
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
# to calculate the version we need the tags and the commit history
fetch-tags: true
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
configFilePath: './.conventional-commits/GitVersion.yml'
- name: Set version output
id: set-version
run: echo "GITVERSION_SEMVER=$GitVersion_MajorMinorPatch$SUFFIX" >> $GITHUB_OUTPUT
env:
SUFFIX: ${{ github.ref != 'refs/heads/main' && format('.dev{0}+{1}', github.run_number, env.GitVersion_ShortSha) || '' }}
build:
runs-on: ubuntu-latest
needs: version
permissions:
contents: read
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Build dotnet dependencies
run: dotnet build src/data_factory_testing_framework/_pythonnet/Evaluator.csproj -o src/data_factory_testing_framework/_pythonnet/bin
- name: Install project
run: poetry run pip install -e .
- name: Run linting and tests
run: poetry run pre-commit run --all-files --show-diff-on-failure
- name: Set build version and build package
run: |
# create a version file with the build version
echo $BUILD_VERSION > VERSION
poetry run python -m build
env:
BUILD_VERSION: ${{ needs.version.outputs.version }}
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: whl
path: dist/*.whl
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
e2e:
needs: build
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
python-version: ['3.9', '3.10', '3.11']
dotnet-version: ['3.1.x', '8.0.x']
# test either wheel or source distribution
dist: [whl, sdist]
uses: ./.github/workflows/e2e.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
dotnet-version: ${{ matrix.dotnet-version }}
dist: ${{ matrix.dist }}