chore(deps-dev): bump eslint from 9.30.0 to 9.37.0 #96
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: Pull Request Check | |
| on: | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| check-and-build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Checkout PR branch | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check formatting with Prettier | |
| id: prettier | |
| run: | | |
| if ! npx prettier --check .; then | |
| echo "PRETTIER_FAILED=true" >> $GITHUB_ENV | |
| fi | |
| - name: Run ESLint | |
| id: eslint | |
| run: | | |
| if ! npx eslint .; then | |
| echo "ESLINT_FAILED=true" >> $GITHUB_ENV | |
| fi | |
| - name: Comment lint or formatter failures | |
| if: env.PRETTIER_FAILED == 'true' || env.ESLINT_FAILED == 'true' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const messages = []; | |
| if (process.env.PRETTIER_FAILED === 'true') { | |
| messages.push("❌ Prettier check failed. Please format your code with `npm run format` before commiting!"); | |
| } | |
| if (process.env.ESLINT_FAILED === 'true') { | |
| messages.push("❌ ESLint check failed. Please fix lint issues with `npm run lint` before commiting!"); | |
| } | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: messages.join('\n') | |
| }); | |
| env: | |
| PRETTIER_FAILED: ${{ env.PRETTIER_FAILED }} | |
| ESLINT_FAILED: ${{ env.ESLINT_FAILED }} | |
| - name: Fail build if linting failed | |
| if: env.PRETTIER_FAILED == 'true' || env.ESLINT_FAILED == 'true' | |
| run: exit 1 | |
| - name: Build Docker image | |
| run: docker build -t mastermind-vue:test . | |
| - name: Run Docker container | |
| run: docker run -d -p 8080:80 --name test-container mastermind-vue:test | |
| - name: Wait for container | |
| run: | | |
| for i in {1..30}; do | |
| curl -s http://localhost:8080 | grep -q '<title>Mastermind – Das klassische Logikspiel online</title>' && exit 0 | |
| echo "Waiting for container..." | |
| sleep 2 | |
| done | |
| echo "❌ Failed to verify running app. See logs below:" | |
| docker logs test-container | |
| exit 1 | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Run Playwright Tests | |
| run: BASE_URL=http://localhost:8080 npm run test:e2e:ci | |
| - name: Upload Playwright Report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 | |
| - name: Parse test results | |
| if: always() | |
| id: parse | |
| run: | | |
| passed=$(jq '[.suites[].specs[].tests[] | select(.results[].status == "passed")] | length' playwright-report/test-results.json) | |
| failed=$(jq '[.suites[].specs[].tests[] | select(.results[].status == "failed")] | length' playwright-report/test-results.json) | |
| total=$(jq '[.suites[].specs[].tests[]] | length' playwright-report/test-results.json) | |
| artifact_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
| echo "summary=**Playwright Test Summary**: ✅ $passed / ❌ $failed / 🧪 $total tests%0A📊 [Complete test result]($artifact_url)" >> $GITHUB_OUTPUT | |
| - name: Add test summary | |
| id: tests_results_summary | |
| if: always() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const summary = `${process.env.SUMMARY}`; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: summary.replace(/%0A/g, '\n') // Ersetze %0A durch echte Zeilenumbrüche | |
| }); | |
| env: | |
| SUMMARY: ${{ steps.parse.outputs.summary }} | |
| - name: Cleanup | |
| if: always() | |
| run: docker rm -f test-container || true |