feat: add github workflow and update readme #13
Workflow file for this run
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: Code Check | |
on: | |
push: | |
branches: | |
- master | |
pull_request: {} | |
concurrency: | |
group: ${{ github.job }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
setup: | |
name: ⚙️ Setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- uses: pnpm/action-setup@v2 | |
name: Install pnpm | |
with: | |
version: 7 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v2 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnm-store- | |
- name: Install dependencies | |
run: pnpm install --no-frozen-lockfile | |
lint: | |
name: ⬣ ESLint | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v2 | |
- name: 📥 Restore pnpm binaries cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v2 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnm-store- | |
- name: 🔬 Lint | |
run: pnpm lint | |
typecheck: | |
name: ʦ TypeScript | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v2 | |
- name: 📥 Restore pnpm binaries cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v2 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnm-store- | |
- name: 🔎 Type check | |
run: pnpm typecheck | |
prettier: | |
name: 💅 Prettier | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- name: ⬇️ Checkout repo | |
uses: actions/checkout@v2 | |
- name: 📥 Restore pnpm binaries cache | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v2 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnm-store- | |
- name: 💅 Prettier check | |
run: pnpm format:check |