Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add lint and format check #208

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Setup pnpm with cache

runs:
using: 'composite'
steps:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 8
run_install: false

- name: Get store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install packages
shell: bash
run: pnpm install
81 changes: 81 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: CI

on:
push:
branches: main
pull_request:

jobs:
install:
name: Install packages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm

library_prettier:
name: Run Prettier in library
needs: install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm
- name: Prettier check
run: pnpm format.check
working-directory: library

library_eslint:
name: Run ESLint in library
needs: install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm
- name: ESLint check
run: pnpm lint
working-directory: library

library_vitest:
name: Run Vitest in library
needs: install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm
- name: Vitest tests
run: pnpm test
working-directory: library

website_prettier:
name: Run Prettier in website
needs: install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm
- name: Prettier check
run: pnpm format.check
working-directory: website

website_eslint:
name: Run ESLint in website
needs: install
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: ./.github/actions/pnpm
- name: ESLint check
run: pnpm lint
working-directory: website
46 changes: 0 additions & 46 deletions .github/workflows/node.yml

This file was deleted.