-
-
Notifications
You must be signed in to change notification settings - Fork 183
118 lines (110 loc) · 2.9 KB
/
ci-cd.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
117
118
---
name: CI/CD
on:
push:
branches:
- master
tags:
- >-
[0-9]+.[0-9]+.[0-9]+
pull_request:
branches:
- master
- >-
[0-9].[0-9]+.[0-9]+
env:
FORCE_COLOR: 1
jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install build dependencies
run: python -m pip install build twine
- name: Build distribution 📦
run: python -m build
- name: Check distribution 📦
run: python -m twine check --strict dist/*
- name: Upload distribution 📦
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.8
- 3.9
- >-
3.10
- 3.11
- 3.12
- 3.13
fail-fast: false
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Lock and sync dependencies
run: |
python -m pip install -U pip pip-tools
pip-compile --all-extras pyproject.toml requirements-dev.in
pip-sync
pip install -e ".[awscli,boto3]"
- name: Run pre-commit hooks
if: matrix.python-version == '3.11'
run: |
make pre-commit
- name: Run unittests
env:
COLOR: 'yes'
run: |
make mototest
- name: Upload coverage to Codecov
if: matrix.python-version == '3.11'
uses: codecov/codecov-action@v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: ./coverage.xml
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
pypi-publish:
name: Publish Python 🐍 distribution 📦 to PyPI
if: github.ref_type == 'tag' # only publish on tag pushes
needs:
- build
- test
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/aiobotocore/${{ github.ref_name }}
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
timeout-minutes: 5
steps:
- name: Download distribution 📦
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1