Skip to content

feat(game-lobby): auto-focus on player name input #3511

feat(game-lobby): auto-focus on player name input

feat(game-lobby): auto-focus on player name input #3511

Workflow file for this run

name: ⚙️ Build Workflow
on:
pull_request:
branches:
- "main"
- "develop"
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
BRANCH_NAME_FORMATTED_FOR_REPORTS: ${BRANCH_NAME//\//_}
REPORTS_URL: https://antoinezanardi.github.io/werewolves-assistant-web-next/reports
UNIT_TESTS_COVERAGE_REPORTS_PATH: tests/unit/coverage
ACCEPTANCE_TESTS_REPORTS_PATH: tests/acceptance/reports
STRYKER_REPORT_PATH: tests/stryker/coverage
GH_TOKEN: ${{ github.token }}
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
code-ql:
name: CodeQL Scan ❇️
runs-on: ubuntu-latest
timeout-minutes: 360
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout GitHub repository 📡
uses: actions/checkout@v4
- name: Initialize CodeQL ⚙️
uses: github/codeql-action/init@v3
with:
languages: javascript
- name: AutoBuild 🌡️
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis ❇️
uses: github/codeql-action/analyze@v3
with:
category: "/language:javascript"
install:
name: Install ⚙️
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub repository 📡
uses: actions/checkout@v4
- name: Install pnpm 🏗️
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup NodeJS ✨
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Cache pnpm dependencies 🥡
uses: actions/cache@v4
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install project dependencies 📦
run: pnpm install
if: steps.cache-node-modules.outputs.cache-hit != 'true'
build:
name: Build ✨
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout GitHub repository 📡
uses: actions/checkout@v4
- name: Install pnpm 🏗️
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup NodeJS ✨
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Restore pnpm dependencies from cache 🥡
uses: actions/cache/restore@v4
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }}
- name: Create Nuxt types ⛰️
run: pnpm run postinstall
- name: Type check 🪨
run: pnpm run typecheck
- name: Build app ✨
run: pnpm run build
lint:
name: Lint 🔍
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout GitHub repository 📡
uses: actions/checkout@v4
- name: Install pnpm 🏗️
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup NodeJS ✨
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Restore pnpm dependencies from cache 🥡
uses: actions/cache/restore@v4
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }}
- name: Create Nuxt types ⛰️
run: pnpm run postinstall
- name: Check and lint code 🔍
run: pnpm run lint
- name: Check gherkin files format 🥒
run: pnpm run prettier:gherkin
unit-tests:
name: Unit Tests 🧪
runs-on: ubuntu-latest
needs:
- install
steps:
- name: Checkout GitHub repository 📡
uses: actions/checkout@v4
- name: Install pnpm 🏗️
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup NodeJS ✨
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Restore pnpm dependencies from cache 🥡
uses: actions/cache/restore@v4
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }}
- name: Create Nuxt types ⛰️
run: pnpm run postinstall
- name: Unit tests 🧪
id: unit-tests
continue-on-error: true
run: pnpm run test:unit:cov
- name: Save unit tests coverage in cache 🥡
uses: actions/cache/save@v4
id: cache-unit-tests-coverage
if: ${{ hashFiles('tests/unit/coverage/lcov.info') }}
with:
path: tests/unit/coverage
key: ${{ runner.os }}-tests-unit-coverage-v3-${{ env.BRANCH_NAME }}-${{hashFiles('tests/unit/coverage/lcov.info')}}
- name: Save unit tests coverage report as artifact 💎
uses: actions/upload-artifact@v4
with:
name: unit-tests-coverage-report
path: ${{ env.UNIT_TESTS_COVERAGE_REPORTS_PATH }}
- name: Exit with error if unit tests failed 🚨
if: steps.unit-tests.outcome != 'success'
run: exit 1;
e2e-tests:
name: E2E Tests ⚗️ 💠
runs-on: ubuntu-latest
needs:
- install
strategy:
matrix:
shard: [ shard-1, shard-2, shard-3, shard-4 ]
steps:
- name: Checkout GitHub repository 📡
uses: actions/checkout@v4
- name: Install pnpm 🏗️
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Check features shard 💠
run: pnpm run script:check-acceptance-features-shard
- name: Setup NodeJS ✨
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Restore pnpm dependencies from cache 🥡
uses: actions/cache/restore@v4
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }}
- name: Create Nuxt types ⛰️
run: pnpm run postinstall
- name: Start Docker Sandbox API containers 🐳
run: pnpm run docker:sandbox-api:start
- name: Prepare E2E tests 🧭
run: pnpm run test:cucumber:prepare
- name: E2E tests ⚗️
id: e2e-tests
continue-on-error: true
run: pnpm run test:cucumber:${{ matrix.shard }}
- name: Save E2E tests reports as artifact 💎
uses: actions/upload-artifact@v4
with:
name: e2e-tests-reports-${{ matrix.shard }}
path: ${{ env.ACCEPTANCE_TESTS_REPORTS_PATH }}
- name: Stop Docker Sandbox API containers 🐳
run: pnpm run docker:sandbox-api:stop
- name: Exit with error if E2E tests failed 🚨
if: steps.e2e-tests.outcome != 'success'
run: exit 1;
mutant-tests:
name: Mutant Tests 👽
runs-on: ubuntu-latest
env:
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
VERSION: ${{ github.head_ref }}
needs:
- install
steps:
- name: Checkout GitHub repository 📡
uses: actions/checkout@v4
- name: Install pnpm 🏗️
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup NodeJS ✨
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Restore pnpm dependencies from cache 🥡
uses: actions/cache/restore@v4
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }}
- name: Create Nuxt types ⛰️
run: pnpm run postinstall
- name: Mutant tests 👽
id: mutant-tests
continue-on-error: true
run: pnpm run test:stryker:ci
- name: Save stryker report as artifact 💎
uses: actions/upload-artifact@v4
with:
name: stryker-html-report
path: ${{ env.STRYKER_REPORT_PATH }}/index.html
- name: Exit with error if mutant tests failed 🚨
if: steps.mutant-tests.outcome != 'success'
run: exit 1;
sonarcloud:
name: SonarCloud Analysis 🌥️
runs-on: ubuntu-latest
needs:
- unit-tests
if: "!startsWith(github.head_ref, 'renovate/')"
steps:
- name: Checkout GitHub repository 📡
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm 🏗️
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Restore pnpm dependencies from cache 🥡
uses: actions/cache/restore@v4
id: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-pnpm-v3-${{ hashFiles('pnpm-lock.yaml') }}
- name: Restore tests coverage from cache 🥡
uses: actions/cache/restore@v4
id: cache-unit-tests-coverage
with:
path: tests/unit/coverage
key: ${{ runner.os }}-tests-unit-coverage-v3-${{ env.BRANCH_NAME }}-
restore-keys: |
${{ runner.os }}-tests-unit-coverage-v3-${{ env.BRANCH_NAME }}-
- name: Create Nuxt types ⛰️
run: pnpm run postinstall
- name: SonarCloud Scan 🌥️
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}