Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/werewolves-assistant-web-next.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268name: ⚙️ Build Workflow
on: pull_request: branches: - 'main' - 'develop'
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@v2 with: version: 8 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@v3 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@v2 with: version: 8 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@v3 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: 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@v2 with: version: 8 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@v3 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
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@v2 with: version: 8 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@v3 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 🧪 run: pnpm run test:unit:cov
- name: Save tests coverage in cache 🥡 uses: actions/cache/save@v3 id: cache-unit-tests-coverage with: path: tests/unit/coverage key: ${{ runner.os }}-tests-unit-coverage-v3-${{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: tests/unit/coverage
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@v2 with: version: 8 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@v3 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 👽 run: pnpm run test:stryker:ci
- name: Save stryker report as artifact 💎 uses: actions/upload-artifact@v4 with: name: stryker-html-report path: tests/stryker/coverage/index.html
sonarcloud: name: SonarCloud Analysis 🌥️ runs-on: ubuntu-latest needs: - unit-tests if: "!startsWith(github.head_ref, 'dependabot/')" steps: - name: Checkout GitHub repository 📡 uses: actions/checkout@v4 with: fetch-depth: 0
- name: Install pnpm 🏗️ uses: pnpm/action-setup@v2 with: version: 8 run_install: false
- name: Restore pnpm dependencies from cache 🥡 uses: actions/cache/restore@v3 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@v3 id: cache-unit-tests-coverage with: path: tests/unit/coverage key: ${{ runner.os }}-tests-unit-coverage-v3- restore-keys: | ${{ runner.os }}-tests-unit-coverage-v3-
- 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 }}