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

build: add generate check in CI #221

Merged
merged 15 commits into from
Nov 21, 2024
41 changes: 41 additions & 0 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Code generation

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
paths:
- 'pnpm-lock.yaml'
- 'scripts/**'
- '.github/workflows/generate.yml'
push:
branches:
- main
- 'renovate/**'
paths:
- 'pnpm-lock.yaml'
- 'scripts/**'
- '.github/workflows/generate.yml'

jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ./.github/actions/pnpm

- name: Clone oxc_linter project
run: pnpm run clone

- name: Remove current generated code
run: rm -r ./src/generated/

- name: Generate from source code
run: pnpm run generate

- name: Format generated code
run: pnpm run format

- name: Check for git diff
run: git diff --exit-code