Skip to content

Suggest change

Suggest change #76

Workflow file for this run

name: Run e2e test fix process when PR created or updated
on:
pull_request:
permissions:
packages: read
contents: read
pull-requests: write
jobs:
e2e-test:
runs-on: ubuntu-latest
env:
GITHUB_PACKAGES_NPM_READ_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install dependencies
run: npm ci
- name: Download gumtree
run: docker pull rozelin/gumtree:latest
- name: Set branch environment variables
run: |
echo "REMOTE=${{ github.event.pull_request.base.ref }}" >> $GITHUB_ENV
echo "LOCAL=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
# - name: Diff matching
# run: |
# chmod +x ./scripts/diff-match/index.sh
# ./scripts/diff-match/index.sh ${{ github.event.pull_request.base.ref }} ${{ github.event.pull_request.head.ref }}
- name: Diff matching for multi files
run: |
chmod +x ./scripts/diff-match/for-multi.sh
./scripts/diff-match/for-multi.sh ${{ github.event.pull_request.base.ref }} ${{ github.event.pull_request.head.ref }}
env:
GH_TOKEN: ${{ github.token }}
- name: ID embedding
run: |
chmod +x ./scripts/id-embedding/index.sh
./scripts/id-embedding/index.sh
- name: Install ChromeDriver
uses: nanasess/setup-chromedriver@v2
- name: Start server
run: |
npm run dev &
echo $! > server.pid
sleep 30
- name: Run e2e tests
run: node --test
continue-on-error: true
- name: Stop server
run: kill $(cat server.pid)
# comment on PR with results
- name: List and display file contents
run: |
chmod +x ./scripts/suggest-repair/index.sh
./scripts/suggest-repair/index.sh
- name: Comment on PR
run: gh pr comment ${{ github.event.number }} --body-file comment.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}