Skip to content

Commit 222c198

Browse files
committed
feat: regression CI
1 parent e7e4d1e commit 222c198

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/regression.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Regression Test
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
run_all_tests:
8+
runs-on: ubuntu-latest
9+
#if: "!contains(github.event.pull_request.title, '[NO-REGRESSION-TEST]')"
10+
steps:
11+
- name: Checkout pull request code
12+
uses: actions/checkout@v4
13+
with:
14+
path: 'pr_repo'
15+
16+
- name: Checkout main branch code
17+
uses: actions/checkout@v4
18+
with:
19+
ref: 'main'
20+
path: 'main_repo'
21+
22+
- name: Setup Go environment
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: '1.22'
26+
27+
- name: Compile both binaries
28+
run: |
29+
(cd main_repo && go build -o ../abcoder_old)
30+
(cd pr_repo && go build -o ../abcoder_new)
31+
32+
- name: Run test scripts and generate outputs
33+
run: |
34+
OUTDIR=out_old ABCEXE=./abcoder_old ./pr_repo/script/run_all_testdata.sh
35+
OUTDIR=out_new ABCEXE=./abcoder_new ./pr_repo/script/run_all_testdata.sh
36+
37+
- name: Compare outputs and check for regression
38+
id: diff_check
39+
run: ./pr_repo/script/diffjson.py out_old out_new
40+
continue-on-error: true
41+
42+
- name: Upload output directories
43+
uses: actions/upload-artifact@v4
44+
if: always()
45+
with:
46+
name: regression-outputs
47+
path: |
48+
out_old
49+
out_new
50+
retention-days: 3

0 commit comments

Comments
 (0)