Skip to content

Commit 484498c

Browse files
committed
fix: fix regression CI
1 parent efac10b commit 484498c

3 files changed

Lines changed: 33 additions & 11 deletions

File tree

.github/workflows/regression.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,60 @@ name: Regression Test
22

33
on:
44
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
510

611
jobs:
712
run_all_tests:
813
runs-on: ubuntu-latest
914
#if: "!contains(github.event.pull_request.title, '[NO-REGRESSION-TEST]')"
1015
steps:
16+
- name: Setup Go environment
17+
uses: actions/setup-go@v5
18+
with:
19+
go-version: '1.22'
20+
21+
- name: Setup Rust toolchain
22+
uses: dtolnay/rust-toolchain@stable
23+
with:
24+
toolchain: stable
25+
components: rust-analyzer
26+
27+
- name: Setup Python environment
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: '3.11'
31+
1132
- name: Checkout pull request code
1233
uses: actions/checkout@v4
1334
with:
1435
path: 'pr_repo'
36+
submodules: true
37+
38+
- name: Install Python dependencies
39+
run: |
40+
pip install -r ./pr_repo/script/requirements.txt
41+
pip install ./pr_repo/pylsp
1542
1643
- name: Checkout main branch code
1744
uses: actions/checkout@v4
1845
with:
1946
ref: 'main'
2047
path: 'main_repo'
2148

22-
- name: Setup Go environment
23-
uses: actions/setup-go@v5
24-
with:
25-
go-version: '1.22'
26-
2749
- name: Compile both binaries
2850
run: |
2951
(cd main_repo && go build -o ../abcoder_old)
3052
(cd pr_repo && go build -o ../abcoder_new)
31-
53+
3254
- name: Run test scripts and generate outputs
3355
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-
56+
LANGS="go rust python" OUTDIR=out_old ABCEXE=./abcoder_old ./pr_repo/script/run_all_testdata.sh
57+
LANGS="go rust python" OUTDIR=out_new ABCEXE=./abcoder_new ./pr_repo/script/run_all_testdata.sh
58+
3759
- name: Compare outputs and check for regression
3860
id: diff_check
3961
run: ./pr_repo/script/diffjson.py out_old out_new

script/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
deepdiff

script/run_all_testdata.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ REPO_ROOT=$(realpath --relative-to=$(pwd) "$SCRIPT_DIR/..")
1717
ABCEXE=${ABCEXE:-"$REPO_ROOT/abcoder"}
1818
OUTDIR=${OUTDIR:?Error: OUTDIR is a mandatory environment variable}
1919
PARALLEL_FLAGS=${PARALLEL_FLAGS:---tag}
20-
21-
LANGS=(go rust python cxx)
20+
LANGS=${LANGS:-"go rust python cxx"}
2221

2322
detect_jobs() {
2423
local ABCEXE=${1:-$ABCEXE}

0 commit comments

Comments
 (0)