[DEPENDA-BOT] test: ci auto label #734
This file contains 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: CI workflow | |
concurrency: | |
group: ${{ github.head_ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
branches: '**' | |
workflow_dispatch: | |
env: | |
APPLICATION_FOLDER: ~/game-lobby/frontend | |
NEXT_PUBLIC_MOCK: true | |
NEXT_PUBLIC_CI_MODE: true | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
~/.cache/Cypress | |
key: deps-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: Build | |
run: yarn build | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: PR-${{ github.event.pull_request.number }}-build-artifacts | |
path: ${{ github.workspace }}/.next | |
- name: Bundle Watch | |
shell: bash | |
env: | |
CI_REPO_OWNER: Game-as-a-Service | |
CI_REPO_NAME: Game-Lobby-Web | |
CI_BRANCH: ${{ github.head_ref }} | |
CI_BRANCH_BASE: ${{ github.base_ref }} | |
CI_COMMIT_SHA: ${{ github.sha }} | |
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} | |
run: yarn run bundlewatch | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
~/.cache/Cypress | |
key: deps-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: Test | |
run: yarn test | |
lint: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
~/.cache/Cypress | |
key: deps-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: lint | |
run: npx [email protected] --no-error-on-unmatched-pattern -c .eslintrc.json $(git diff --name-only --relative --diff-filter=ACMRTUXB HEAD~1 | grep -E ".(js|jsx|ts|tsx)$") | |
knip-scan: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
~/.cache/Cypress | |
key: deps-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: knip | |
env: | |
GIT_TOKEN: ${{ secrets.GIT_TOKEN }} | |
run: | | |
yarn run knip > knipScanResult.txt 2>&1 | |
node ./scripts/knipScanReporter.js | |
lhci-scan: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
~/.cache/Cypress | |
key: deps-node-modules-${{ hashFiles('**/yarn.lock') }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: yarn install --frozen-lockfile | |
- name: Download build artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: PR-${{ github.event.pull_request.number }}-build-artifacts | |
path: .next | |
- name: Audit URLs using Lighthouse | |
uses: treosh/lighthouse-ci-action@v10 | |
with: | |
uploadArtifacts: false | |
temporaryPublicStorage: true | |
configPath: ./lighthouserc.js | |
env: | |
LHCI_GITHUB_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | |
- name: lhci PR reporter | |
env: | |
GIT_TOKEN: ${{ secrets.GIT_TOKEN }} | |
run: node ./scripts/lhciScanReporter.js |