Multi update #71
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: 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: | | |
| DIR="result" | |
| OUTPUT="## Result of test fix\n\n" | |
| FOUND_FILES=0 | |
| while IFS= read -r -d '' FILE; do | |
| FOUND_FILES=1 | |
| echo "Processing $FILE" | |
| CONTENT=$(cat "$FILE") | |
| OUTPUT+="### Contents of \`$(basename "$FILE")\`\n\n\`\`\`\n$CONTENT\n\`\`\`\n\n" | |
| done < <(find "$DIR" -maxdepth 1 -type f -print0) | |
| if [ "$FOUND_FILES" -eq 0 ]; then | |
| OUTPUT="No test fix required" | |
| fi | |
| echo -e "$OUTPUT" > comment.txt | |
| - name: Comment on PR | |
| run: gh pr comment ${{ github.event.number }} --body-file comment.txt | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |