Skip to content

Commit dc61572

Browse files
committed
fix: fix regression CI
1 parent b2172bb commit dc61572

3 files changed

Lines changed: 28 additions & 11 deletions

File tree

.github/workflows/regression.yml

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,49 @@ jobs:
88
runs-on: ubuntu-latest
99
#if: "!contains(github.event.pull_request.title, '[NO-REGRESSION-TEST]')"
1010
steps:
11+
- name: Setup Go environment
12+
uses: actions/setup-go@v5
13+
with:
14+
go-version: '1.22'
15+
16+
- name: Setup Rust toolchain
17+
uses: dtolnay/rust-toolchain@stable
18+
with:
19+
toolchain: stable
20+
components: rust-analyzer
21+
22+
- name: Setup Python environment
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.11'
26+
1127
- name: Checkout pull request code
1228
uses: actions/checkout@v4
1329
with:
1430
path: 'pr_repo'
31+
submodules: true
32+
33+
- name: Install Python dependencies
34+
run: |
35+
pip install -r ./pr_repo/script/requirements.txt
36+
pip install ./pr_repo/pylsp
1537
1638
- name: Checkout main branch code
1739
uses: actions/checkout@v4
1840
with:
1941
ref: 'main'
2042
path: 'main_repo'
2143

22-
- name: Setup Go environment
23-
uses: actions/setup-go@v5
24-
with:
25-
go-version: '1.22'
26-
2744
- name: Compile both binaries
2845
run: |
2946
(cd main_repo && go build -o ../abcoder_old)
3047
(cd pr_repo && go build -o ../abcoder_new)
31-
48+
3249
- name: Run test scripts and generate outputs
3350
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-
51+
LANGS="go rust python" OUTDIR=out_old ABCEXE=./abcoder_old ./pr_repo/script/run_all_testdata.sh
52+
LANGS="go rust python" OUTDIR=out_new ABCEXE=./abcoder_new ./pr_repo/script/run_all_testdata.sh
53+
3754
- name: Compare outputs and check for regression
3855
id: diff_check
3956
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)