Skip to content

Commit

Permalink
ci: add lint workflow for pushes to main
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 6, 2023
1 parent ae81407 commit f141b8d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: autofix.ci # needed to securely identify the workflow

on:
pull_request:
branches:
- main

permissions:
contents: read
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: ci

on:
push:
branches:
- main
pull_request:
branches:
- main

# https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml
env:
# 7 GiB by default on GitHub, setting to 6 GiB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NODE_OPTIONS: --max-old-space-size=6144
# install playwright binary manually (because pnpm only runs install script once)
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"


# Remove default permissions of GITHUB_TOKEN for security
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: ${{ github.event_name != 'push' }}

jobs:
lint:
# autofix workflow will be triggered instead for PRs
if: github.event_name == 'push'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: corepack enable
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: 20
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm lint

0 comments on commit f141b8d

Please sign in to comment.