generated from astronomer/airflow-provider-sample
-
Notifications
You must be signed in to change notification settings - Fork 4
116 lines (102 loc) · 3.15 KB
/
provider.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
name: Provider
on:
push:
branches:
- main
paths-ignore:
- buildkit/**
- '.github/workflows/buildkit.yml'
tags:
- 'provider/**'
pull_request:
paths-ignore:
- buildkit/**
- '.github/workflows/buildkit.yml'
jobs:
test:
strategy:
matrix:
platform:
- ubuntu-latest
python-version:
- '3.7'
# - '3.8'
# - '3.9'
# - '3.10'
- '3.11'
include:
# And for one matrix job, upload the artifacts for every PR/build
- python-verion: '3.11'
platform: ubuntu-latest
wheels-to-artifacts: true
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- id: setup
name: Setup toolchains
uses: ./.github/actions/setup-env
with:
python-version: ${{ matrix.python-version }}
python-extras: |
build
wheel
- run: "pip install '.[tests]' -v"
- name: python tests
run: python -m pytest
- name: build wheel
uses: hynek/build-and-inspect-python-package@v1
# Don't build wheel here if we'd do a full build anyway
if: matrix.wheels-to-artifacts && (github.ref_type != 'tag' && github.ref != 'refs/heads/main' && !contains(github.event.pull_request.labels.*.name, 'Full Build'))
lint:
uses: ./.github/workflows/lint.yml
# https://github.com/marketplace/actions/alls-green#why used for branch protection checks
check:
if: always()
needs: [test, lint]
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
build:
strategy:
matrix:
os: [ubuntu]
target: [x86_64]
name: build on ${{ matrix.os }} (${{ matrix.target }})
# only run on push to main and on release, or with tag
if: "success() && (github.ref_type == 'tag' || github.ref == 'refs/heads/main' || contains(github.event.pull_request.labels.*.name, 'Full Build'))"
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
- uses: hynek/build-and-inspect-python-package@v1
release:
needs: [build, check]
if: "success() && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: get dist artifacts
uses: actions/download-artifact@v3
with:
name: Packages
path: dist
- id: check-version
name: check package version
run: python .github/check-version.py
- run: pip install twine
if: ${{ ! steps.check-version.outputs.is_prerelease }}
- name: upload to pypi
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_token }}
if: ${{ ! steps.check-version.outputs.is_prerelease }}
- name: upload to github release
uses: softprops/action-gh-release@v1
with:
files: |
dist/*
generate_release_notes: true
prerelease: ${{ steps.check-version.outputs.is_prerelease }}