8000 Switch to `jinja2` for generating CI yamls (#2534) · davidcroda/sentry-python@c025ffe · GitHub
[go: up one dir, main page]

Skip to content

Commit c025ffe

Browse files
authored
Switch to jinja2 for generating CI yamls (getsentry#2534)
The current approach was becoming hard to maintain. This should make it easier to integrate new frameworks.
1 parent 12b8f98 commit c025ffe

File tree

54 files changed

+605
-1536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+605
-1536
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
python-version: 3.12
4545

4646
- run: |
47+
pip install jinja2
4748
python scripts/split-tox-gh-actions/split-tox-gh-actions.py --fail-on-changes
4849
4950
build_lambda_layer:

.github/workflows/test-common.yml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
11
name: Test common
2-
32
on:
43
push:
54
branches:
65
- master
76
- release/**
8-
97
pull_request:
10-
118
# Cancel in progress workflows on pull_requests.
129
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
1310
concurrency:
1411
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1512
cancel-in-progress: true
16-
1713
permissions:
1814
contents: read
19-
2015
env:
2116
BUILD_CACHE_KEY: ${{ github.sha }}
2217
CACHED_BUILD_PATHS: |
2318
${{ github.workspace }}/dist-serverless
24-
2519
jobs:
26-
test:
27-
name: common, python ${{ matrix.python-version }}, ${{ matrix.os }}
28-
runs-on: ${{ matrix.os }}
20+
test-pinned:
2921
timeout-minutes: 30
30-
22+
name: common pinned, python ${{ matrix.python-version }}, ${{ matrix.os }}
23+
runs-on: ${{ matrix.os }}
3124
strategy:
3225
fail-fast: false
3326
matrix:
@@ -37,17 +30,14 @@ jobs:
3730
# ubuntu-20.04 is the last version that supported python3.6
3831
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3932
os: [ubuntu-20.04]
40-
4133
steps:
4234
- uses: actions/checkout@v4
4335
- uses: actions/setup-python@v4
4436
with:
4537
python-version: ${{ matrix.python-version }}
46-
4738
- name: Setup Test Env
4839
run: |
4940
pip install coverage "tox>=3,<4"
50-
5141
- name: Test common
5242
uses: nick-fields/retry@v2
5343
with:
@@ -58,30 +48,24 @@ jobs:
5848
command: |
5949
set -x # print commands that are executed
6050
coverage erase
61-
6251
# Run tests
6352
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
6453
coverage combine .coverage* &&
6554
coverage xml -i
66-
6755
- uses: codecov/codecov-action@v3
6856
with:
6957
token: ${{ secrets.CODECOV_TOKEN }}
7058
files: coverage.xml
71-
7259
test-py27:
73-
name: common, python 2.7, ubuntu-20.04
60+
timeout-minutes: 30
61+
name: common py27, python 2.7
7462
runs-on: ubuntu-20.04
7563
container: python:2.7
76-
timeout-minutes: 30
77-
7864
steps:
7965
- uses: actions/checkout@v4
80-
8166
- name: Setup Test Env
8267
run: |
8368
pip install coverage "tox>=3,<4"
84-
8569
- name: Test common
8670
uses: nick-fields/retry@v2
8771
with:
@@ -92,22 +76,23 @@ jobs:
9276
command: |
9377
set -x # print commands that are executed
9478
coverage erase
95-
9679
# Run tests
9780
./scripts/runtox.sh --exclude-latest "py2.7-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
9881
coverage combine .coverage* &&
9982
coverage xml -i
100-
101-
83+
- uses: codecov/codecov-action@v3
84+
with:
85+
token: ${{ secrets.CODECOV_TOKEN }}
86+
files: coverage.xml
10287
check_required_tests:
10388
name: All common tests passed or skipped
104-
needs: [test, test-py27]
89+
needs: [test-pinned, test-py27]
10590
# Always run this, even if a dependent job failed
10691
if: always()
10792
runs-on: ubuntu-20.04
10893
steps:
10994
- name: Check for failures
110-
if: contains(needs.test.result, 'failure')
95+
if: contains(needs.test-pinned.result, 'failure')
11196
run: |
11297
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
11398
- name: Check for 2.7 failures
Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
11
name: Test aiohttp
2-
32
on:
43
push:
54
branches:
65
- master
76
- release/**
8-
97
pull_request:
10-
118
# Cancel in progress workflows on pull_requests.
129
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
1310
concurrency:
1411
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1512
cancel-in-progress: true
16-
1713
permissions:
1814
contents: read
19-
2015
env:
2116
BUILD_CACHE_KEY: ${{ github.sha }}
2217
CACHED_BUILD_PATHS: |
2318
${{ github.workspace }}/dist-serverless
24-
2519
jobs:
26-
test:
27-
name: aiohttp, python ${{ matrix.python-version }}, ${{ matrix.os }}
28-
runs-on: ${{ matrix.os }}
20+
test-pinned:
2921
timeout-minutes: 30
30-
22+
name: aiohttp pinned, python ${{ matrix.python-version }}, ${{ matrix.os }}
23+
runs-on: ${{ matrix.os }}
3124
strategy:
3225
fail-fast: false
3326
matrix:
@@ -37,17 +30,14 @@ jobs:
3730
# ubuntu-20.04 is the last version that supported python3.6
3831
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3932
os: [ubuntu-20.04]
40-
4133
steps:
4234
- uses: actions/checkout@v4
4335
- uses: actions/setup-python@v4
4436
with:
4537
python-version: ${{ matrix.python-version }}
46-
4738
- name: Setup Test Env
4839
run: |
4940
pip install coverage "tox>=3,<4"
50-
5141
- name: Test aiohttp
5242
uses: nick-fields/retry@v2
5343
with:
@@ -58,23 +48,18 @@ jobs:
5848
command: |
5949
set -x # print commands that are executed
6050
coverage erase
61-
6251
# Run tests
6352
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aiohttp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
6453
coverage combine .coverage* &&
6554
coverage xml -i
66-
6755
- uses: codecov/codecov-action@v3
6856
with:
6957
token: ${{ secrets.CODECOV_TOKEN }}
7058
files: coverage.xml
71-
72-
7359
test-latest:
60+
timeout-minutes: 30
7461
name: aiohttp latest, python ${{ matrix.python-version }}, ${{ matrix.os }}
7562
runs-on: ${{ matrix.os }}
76-
timeout-minutes: 30
77-
7863
strategy:
7964
fail-fast: false
8065
matrix:
@@ -84,17 +69,14 @@ jobs:
8469
# ubuntu-20.04 is the last version that supported python3.6
8570
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
8671
os: [ubuntu-20.04]
87-
8872
steps:
8973
- uses: actions/checkout@v4
9074
- uses: actions/setup-python@v4
9175
with:
9276
python-version: ${{ matrix.python-version }}
93-
9477
- name: Setup Test Env
9578
run: |
9679
pip install coverage "tox>=3,<4"
97-
9880
- name: Test aiohttp
9981
uses: nick-fields/retry@v2
10082
with:
@@ -105,25 +87,22 @@ jobs:
10587
command: |
10688
set -x # print commands that are executed
10789
coverage erase
108-
10990
# Run tests
11091
./scripts/runtox.sh "py${{ matrix.python-version }}-aiohttp-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
11192
coverage combine .coverage* &&
11293
coverage xml -i
113-
11494
- uses: codecov/codecov-action@v3
11595
with:
11696
token: ${{ secrets.CODECOV_TOKEN }}
11797
files: coverage.xml
118-
11998
check_required_tests:
12099
name: All aiohttp tests passed or skipped
121-
needs: test
100+
needs: test-pinned
122101
# Always run this, even if a dependent job failed
123102
if: always()
124103
runs-on: ubuntu-20.04
125104
steps:
126105
- name: Check for failures
127-
if: contains(needs.test.result, 'failure')
106+
if: contains(needs.test-pinned.result, 'failure')
128107
run: |
129108
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
11
name: Test ariadne
2-
32
on:
43
push:
54
branches:
65
- master
76
- release/**
8-
97
pull_request:
10-
118
# Cancel in progress workflows on pull_requests.
129
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
1310
concurrency:
1411
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1512
cancel-in-progress: true
16-
1713
permissions:
1814
contents: read
19-
2015
env:
2116
BUILD_CACHE_KEY: ${{ github.sha }}
2217
CACHED_BUILD_PATHS: |
2318
${{ github.workspace }}/dist-serverless
24-
2519
jobs:
26-
test:
27-
name: ariadne, python ${{ matrix.python-version }}, ${{ matrix.os }}
28-
runs-on: ${{ matrix.os }}
20+
test-pinned:
2921
timeout-minutes: 30
30-
22+
name: ariadne pinned, python ${{ matrix.python-version }}, ${{ matrix.os }}
23+
runs-on: ${{ matrix.os }}
3124
strategy:
3225
fail-fast: false
3326
matrix:
@@ -37,17 +30,14 @@ jobs:
3730
# ubuntu-20.04 is the last version that supported python3.6
3831
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3932
os: [ubuntu-20.04]
40-
4133
steps:
4234
- uses: actions/checkout@v4
4335
- uses: actions/setup-python@v4
4436
with:
4537
python-version: ${{ matrix.python-version }}
46-
4738
- name: Setup Test Env
4839
run: |
4940
pip install coverage "tox>=3,<4"
50-
5141
- name: Test ariadne
5242
uses: nick-fields/retry@v2
5343
with:
@@ -58,23 +48,18 @@ jobs:
5848
command: |
5949
set -x # print commands that are executed
6050
coverage erase
61-
6251
# Run tests
6352
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-ariadne" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
6453
coverage combine .coverage* &&
6554
coverage xml -i
66-
6755
- uses: codecov/codecov-action@v3
6856
with:
6957
token: ${{ secrets.CODECOV_TOKEN }}
7058
files: coverage.xml
71-
72-
7359
test-latest:
60+
timeout-minutes: 30
7461
name: ariadne latest, python ${{ matrix.python-version }}, ${{ matrix.os }}
7562
runs-on: ${{ matrix.os }}
76-
timeout-minutes: 30
77-
7863
strategy:
7964
fail-fast: false
8065
matrix:
@@ -84,17 +69,14 @@ jobs:
8469
# ubuntu-20.04 is the last version that supported python3.6
8570
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
8671
os: [ubuntu-20.04]
87-
8872
steps:
8973
- uses: actions/checkout@v4
9074
- uses: actions/setup-python@v4
9175
with:
9276
python-version: ${{ matrix.python-version }}
93-
9477
- name: Setup Test Env
9578
run: |
9679
pip install coverage "tox>=3,<4"
97-
9880
- name: Test ariadne
9981
uses: nick-fields/retry@v2
10082
with:
@@ -105,25 +87,22 @@ jobs:
10587
command: |
10688
set -x # print commands that are executed
10789
coverage erase
108-
10990
# Run tests
11091
./scripts/runtox.sh "py${{ matrix.python-version }}-ariadne-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch &&
11192
coverage combine .coverage* &&
11293
coverage xml -i
113-
11494
- uses: codecov/codecov-action@v3
11595
with:
11696
token: ${{ secrets.CODECOV_TOKEN }}
11797
files: coverage.xml
118-
11998
check_required_tests:
12099
name: All ariadne tests passed or skipped
121-
needs: test
100+
needs: test-pinned
122101
# Always run this, even if a dependent job failed
123102
if: always()
124103
runs-on: ubuntu-20.04
125104
steps:
126105
- name: Check for failures
127-
if: contains(needs.test.result, 'failure')
106+
if: contains(needs.test-pinned.result, 'failure')
128107
run: |
129108
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

0 commit comments

Comments
 (0)
0