-
Notifications
You must be signed in to change notification settings - Fork 3
99 lines (98 loc) · 3.64 KB
/
version-testing.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: Version Testing
on:
push:
schedule:
- cron: "0 7 * * *"
jobs:
# If this key gets renamed, nox.py needs to be adjusted
check-new-versions-of-instrumented-packages:
runs-on: ubuntu-latest
strategy:
matrix:
# If this key gets renamed, nox.py needs to be adjusted
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
name: check-new-versions-of-instrumented-packages
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip3 install -r requirements.txt
- run: python3 -m nox
continue-on-error: true
env:
TEST_ONLY_UNTESTED_NEW_VERSIONS: true
- run: git --no-pager diff
- run: mkdir versions_artifact
- run: for path in `git diff --name-only`; do cp "$path" versions_artifact; done
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.python-version }}
path: versions_artifact
create-pr-for-new-versions:
runs-on: ubuntu-latest
name: create-pr-for-new-versions
needs: check-new-versions-of-instrumented-packages
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- run: mkdir versions_artifacts
- uses: actions/download-artifact@v2
continue-on-error: true # when there aren't changes the artifact won't be uploaded and this step will fail
with:
name: 3.7
path: versions_artifacts/3.7
- uses: actions/download-artifact@v2
continue-on-error: true
with:
name: 3.8
path: versions_artifacts/3.8
- uses: actions/download-artifact@v2
continue-on-error: true
with:
name: 3.9
path: versions_artifacts/3.9
- uses: actions/download-artifact@v2
continue-on-error: true
with:
name: '3.10'
path: versions_artifacts/3.10
- uses: actions/download-artifact@v2
continue-on-error: true
with:
name: '3.11'
path: versions_artifacts/3.11
- run: python3 -m pip install -r requirements.txt
- run: python3 -m scripts.gather_version_artifacts
- run: git --no-pager diff
- run: rm -rf versions_artifacts # the artifacts shouldn't be committed
- run: echo "::set-output name=branch_name::$(date +version-testing-%Y%m%d)"
id: branch_name
- run: | # update 'Supported packages' section in README.md
python3 -m scripts.update_supported_packages_documentation
- run: | # need to set an env var in order to support multi-lines output https://trstringer.com/github-actions-multiline-strings/
pwd
ls ./scripts
new_versions="$(./scripts/describe_supported_versions_diff.sh)"
echo "new_versions<<EOF" >> $GITHUB_ENV
echo "$new_versions" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: "${{ secrets.GITHUB_TOKEN }}"
title: ${{steps.branch_name.outputs.branch_name}}
branch: ${{steps.branch_name.outputs.branch_name}}
commit-message: ${{ env.new_versions }}
body: ${{ env.new_versions }}
base: main
labels: version-testing, automerge
reviewers: GuyMoses,saartochner,shanishiri
- run: | # remove all the version testing branches that aren't from today
pwd
ls ./scripts
./scripts/delete_old_version_testing_branches.sh