fix(ci): uninstall to ensure different ts-parser #88
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Regression Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| run_all_tests: | |
| runs-on: ubuntu-latest | |
| #if: "!contains(github.event.pull_request.title, '[NO-REGRESSION-TEST]')" | |
| env: | |
| LANGS: "go rust python java typescript" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: { path: 'pr_repo' } | |
| - uses: actions/checkout@v4 | |
| with: { path: 'main_repo', ref: 'main' } | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.22' | |
| cache-dependency-path: main_repo/go.sum | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: stable | |
| components: rust-analyzer | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Compile both binaries | |
| run: | | |
| (cd main_repo && go build -o ../abcoder_main) | |
| (cd pr_repo && go build -o ../abcoder_pr) | |
| # Uses the pr evaluation script. | |
| - name: Install evaluation dependencies | |
| run: | | |
| pip install -r ./pr_repo/script/requirements.txt | |
| - name: Install dependencies for main branch | |
| run: | | |
| OUTDIR=out_main ABCEXE=./abcoder_main ./pr_repo/script/run_testdata.sh first | |
| echo "JDTLS_ROOT_PATH=$(realpath ./pr_repo/lang/java/lsp/jdtls/jdt-language-server-*)" >> $GITHUB_ENV | |
| - name: Run main branch abcoder | |
| run: | |
| OUTDIR=out_main ABCEXE=./abcoder_main ./pr_repo/script/run_testdata.sh all | |
| # Whether to reset dependencies: | |
| # [n] Go: builtin parser, do not reset | |
| # [n] Rust: assume rls to be same version | |
| # [n] Python: assume pylsp to be same version | |
| # [n] Java: assume jdtls to be same version | |
| # [y] TypeScript: need to reset installed parser | |
| - name: Reset dependencies | |
| run: | | |
| npm uninstall -g abcoder-ts-parser | |
| - name: Install dependencies for PR | |
| run: | | |
| OUTDIR=out_pr ABCEXE=./abcoder_pr ./pr_repo/script/run_testdata.sh first | |
| - name: Run PR abcoder | |
| run: | |
| OUTDIR=out_pr ABCEXE=./abcoder_pr ./pr_repo/script/run_testdata.sh all | |
| - name: Upload output directories | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: regression-outputs | |
| path: | | |
| out_main | |
| out_pr | |
| retention-days: 3 | |
| - name: Compare outputs and check for regression | |
| run: ./pr_repo/script/diffjson.py out_main out_pr |