Created
September 11, 2023 19:30
-
-
Save adicuco/8e850d4b177f3e1a52c26073daf24899 to your computer and use it in GitHub Desktop.
CI GitHub Action for linting and type checking
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: ⚙️ 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