Skip to content

Instantly share code, notes, and snippets.

@adicuco
Created September 11, 2023 19:30
Show Gist options
  • Save adicuco/8e850d4b177f3e1a52c26073daf24899 to your computer and use it in GitHub Desktop.
Save adicuco/8e850d4b177f3e1a52c26073daf24899 to your computer and use it in GitHub Desktop.
CI GitHub Action for linting and type checking
name: ⚙️ CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: 🚦 Lint
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: ⎔ Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
# ESLint and Prettier must be in `package.json`
- name: 📥 Install dependencies
run: npm ci
- name: 🔎 Run linter
uses: wearerequired/lint-action@v2
with:
eslint: true
prettier: true
typecheck:
name: 👮‍♂️ Typecheck
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v3
- name: ⎔ Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: 📥 Install dependencies
run: npm ci
- name: 🚦 Run typecheck
run: npm run typecheck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment