forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 18
93 lines (92 loc) · 3.5 KB
/
task-sdk-tests.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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
---
name: Task SDK tests
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
runs-on-as-json-default:
description: "The array of labels (in json form) determining default runner used for the build."
required: true
type: string
default-python-version:
description: "Which version of python should be used by default"
required: true
type: string
python-versions:
description: "JSON-formatted array of Python versions to build images from"
required: true
type: string
run-task-sdk-tests:
description: "Whether to run Task SDK tests or not (true/false)"
required: true
type: string
use-uv:
description: "Whether to use uv to build the image (true/false)"
required: true
type: string
canary-run:
description: "Whether this is a canary run (true/false)"
required: true
type: string
jobs:
task-sdk-tests:
timeout-minutes: 80
name: Task SDK:P${{ matrix.python-version }} tests
runs-on: ${{ fromJSON(inputs.runs-on-as-json-default) }}
strategy:
fail-fast: false
matrix:
python-version: "${{fromJSON(inputs.python-versions)}}"
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
INCLUDE_NOT_READY_PROVIDERS: "true"
PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}"
VERBOSE: "true"
CLEAN_AIRFLOW_INSTALLATION: "${{ inputs.canary-run }}"
steps:
- name: "Cleanup repo"
shell: bash
run: docker run -v "${GITHUB_WORKSPACE}:/workspace" -u 0:0 bash -c "rm -rf /workspace/*"
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
persist-credentials: false
- name: "Prepare breeze & CI image: ${{ matrix.python-version }}"
uses: ./.github/actions/prepare_breeze_and_image
with:
platform: "linux/amd64"
python: ${{ matrix.python-version }}
use-uv: ${{ inputs.use-uv }}
- name: "Cleanup dist files"
run: rm -fv ./dist/*
- name: "Prepare Task SDK packages: wheel"
run: >
breeze release-management prepare-task-sdk-package --package-format wheel
- name: "Verify wheel packages with twine"
run: |
uv tool uninstall twine || true
uv tool install twine && twine check dist/*.whl
- name: >
Run unit tests for Airflow Task SDK:Python ${{ matrix.python-version }}
env:
PYTHON_VERSION: "${{ matrix.python-version }}"
run: >
breeze testing task-sdk-tests --python "${PYTHON_VERSION}"