Feat/monorepo #31
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: Frontend Code Style | |
on: | |
pull_request: | |
branches: | |
- '!main' | |
- '!master' | |
- '**' | |
paths: | |
- 'frontend/**' | |
jobs: | |
build: | |
defaults: | |
run: | |
working-directory: ./frontend | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- uses: actions/cache@v3 | |
name: Setup npm cache | |
id: cache-node-modules | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-npm-store-${{ hashFiles('./package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm-store- | |
- name: Install node modules | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm install --no-lockfile --prefer-offline | |
- name: Build the project | |
run: npm run build | |
check-svelte: | |
defaults: | |
run: | |
working-directory: ./frontend | |
name: Check Svelte | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- uses: actions/cache@v3 | |
name: Setup npm cache | |
id: cache-node-modules | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-npm-store-${{ hashFiles('./package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm-store- | |
- name: Install node modules | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm install --no-lockfile --prefer-offline | |
- name: Do svelte check | |
run: npm run check:svelte | |
check-format: | |
defaults: | |
run: | |
working-directory: ./frontend | |
name: Check format | |
needs: build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- uses: actions/cache@v3 | |
name: Setup npm cache | |
id: cache-node-modules | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-npm-store-${{ hashFiles('./package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm-store- | |
- name: Install node modules | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm install --no-lockfile --prefer-offline | |
- name: Run Prettier | |
run: npm run format:check | |
check-code-quality: | |
defaults: | |
run: | |
working-directory: ./frontend | |
name: Check code quality | |
needs: build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- uses: actions/cache@v3 | |
name: Setup npm cache | |
id: cache-node-modules | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-npm-store-${{ hashFiles('./package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm-store- | |
- name: Install node modules | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm install --no-lockfile --prefer-offline | |
- name: Run ESLint | |
run: npm run lint | |
run-tests: | |
defaults: | |
run: | |
working-directory: ./frontend | |
name: Run tests | |
needs: build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- uses: actions/cache@v3 | |
name: Setup npm cache | |
id: cache-node-modules | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-npm-store-${{ hashFiles('./package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-npm-store- | |
- name: Install node modules | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm install --no-lockfile --prefer-offline | |
- name: Run tests | |
run: npm run test |