194 lines
4.7 KiB
YAML
194 lines
4.7 KiB
YAML
name: frontend
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
tags:
|
|
paths:
|
|
- ".github/workflows/ci-frontend.yml"
|
|
- "frontend/**"
|
|
- "!**.md"
|
|
pull_request:
|
|
paths:
|
|
- ".github/workflows/ci-frontend.yml"
|
|
- "frontend/**"
|
|
- "!**.md"
|
|
|
|
jobs:
|
|
check-translations:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node: [16.15.1]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v2.0.1
|
|
id: pnpm-install
|
|
with:
|
|
version: 7
|
|
run_install: false
|
|
|
|
- name: Get pnpm store directory
|
|
id: pnpm-cache
|
|
run: |
|
|
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Install dependencies
|
|
run: pnpm i --loglevel warn
|
|
working-directory: ./frontend
|
|
|
|
- name: Run translations check
|
|
run: pnpm run check:translation
|
|
working-directory: ./frontend
|
|
|
|
check-typescript:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node: [16.15.1]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v2.0.1
|
|
id: pnpm-install
|
|
with:
|
|
version: 7
|
|
run_install: false
|
|
|
|
- name: Get pnpm store directory
|
|
id: pnpm-cache
|
|
run: |
|
|
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Install dependencies
|
|
run: pnpm i --loglevel warn
|
|
working-directory: ./frontend
|
|
|
|
- name: Run type check
|
|
run: pnpm run check:types
|
|
working-directory: ./frontend
|
|
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node: [16.15.1]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v2.0.1
|
|
id: pnpm-install
|
|
with:
|
|
version: 7
|
|
run_install: false
|
|
|
|
- name: Get pnpm store directory
|
|
id: pnpm-cache
|
|
run: |
|
|
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Install dependencies
|
|
run: pnpm i --loglevel warn
|
|
working-directory: ./frontend
|
|
|
|
- name: Run linters
|
|
run: pnpm run lint
|
|
working-directory: ./frontend
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
node: [16.15.1]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
|
|
- name: Install pnpm
|
|
uses: pnpm/action-setup@v2.0.1
|
|
id: pnpm-install
|
|
with:
|
|
version: 7
|
|
run_install: false
|
|
|
|
- name: Get pnpm store directory
|
|
id: pnpm-cache
|
|
run: |
|
|
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
|
|
|
|
- name: Setup pnpm cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
- name: Install dependencies
|
|
run: pnpm i --loglevel warn
|
|
working-directory: ./frontend
|
|
|
|
- name: Collect tests coverage
|
|
run: pnpm run test --coverage
|
|
working-directory: ./frontend
|
|
|
|
- name: Submit coverage
|
|
run: ${{ github.workspace }}/frontend/node_modules/.bin/codecov
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|