-
Notifications
You must be signed in to change notification settings - Fork 6
119 lines (97 loc) · 3.7 KB
/
regression-generate.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
119
name: Regression | Generate
on:
workflow_dispatch:
jobs:
generate-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y gcc-9 gcc-10 gcc-11 gcc-12
- name: Install CWhy
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .
- name: Generate current prompts
run: python3 tests/regression.py --platform ubuntu --generate
- name: Commit
run: |
git config user.name github-actions
git config user.email [email protected]
git switch -c bot/regression/ubuntu
if [[ `git status --porcelain` ]]; then
git add tests/.regression
git commit -m "[bot][ubuntu] Generate current state of CWhy prompts"
fi
git push origin --delete bot/regression/ubuntu || true
git push origin bot/regression/ubuntu
generate-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install CWhy
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .
- name: Generate current prompts
run: python3 tests/regression.py --platform macos --generate
- name: Commit
run: |
git config user.name github-actions
git config user.email [email protected]
git switch -c bot/regression/macos
if [[ `git status --porcelain` ]]; then
git add tests/.regression
git commit -m "[bot][macos] Generate current state of CWhy prompts"
fi
git push origin --delete bot/regression/macos || true
git push origin bot/regression/macos
generate-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install CWhy
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .
- name: Generate current prompts
run: python3 tests/regression.py --platform windows --generate
- name: Commit
run: |
git config user.name github-actions
git config user.email [email protected]
git switch -c bot/regression/windows
$status = git status --porcelain
if (!$status) {
git add tests/.regression
git commit -m "[bot][windows] Generate current state of CWhy prompts"
}
git push origin --delete bot/regression/windows || true
git push origin bot/regression/windows
create-pull-request:
needs: [generate-ubuntu, generate-macos, generate-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Merge branches
run: |
git switch -c bot/regression
git pull --rebase origin bot/regression/ubuntu
git pull --rebase origin bot/regression/macos
git pull --rebase origin bot/regression/windows
git push origin --delete bot/regression || true
git push origin --delete bot/regression/ubuntu
git push origin --delete bot/regression/macos
git push origin --delete bot/regression/windows
git push origin bot/regression
- name: Create pull request
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/plasma-umass/cwhy/pulls \
-d '{"title":"[bot] Generate current state of CWhy prompts","body":"Timestamp: ${{github.event.repository.updated_at}}","head":"bot/regression","base":"main"}'