-
Notifications
You must be signed in to change notification settings - Fork 30
chore: add checks for schema changes #1992
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
Changes from 2 commits
1d4bc5c
5589a18
47ccb66
edd0c86
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,23 @@ env: | |
| CI: true | ||
|
|
||
| jobs: | ||
| pre-commit-checks: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might be worth to include timeout just in case |
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wont we need to setup node (and pnpm) to be able to run the frontend linters?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice catch. Pre-commit is able to setup isolated environments, including for node, but we are not using that for the frontend checks
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might be better to reuse setup-backend
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need poetry and dependencies, as pre-commit should use its own environment for running tests |
||
| with: | ||
| python-version: 3.13 | ||
| - name: Cache Pre-Commit Hooks | ||
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | ||
| with: | ||
| path: ~/.cache/pre-commit | ||
| key: pre-commit-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
| - name: Setup pre-commit | ||
| run: pip install pre-commit | ||
| - name: Run pre-commit hooks | ||
| run: pre-commit run --all-files --show-diff-on-failure | ||
|
|
||
| setup-node: | ||
| if: github.event.pull_request.draft != true | ||
| runs-on: ubuntu-latest | ||
|
|
@@ -44,34 +61,6 @@ jobs: | |
| run: pnpm install --frozen-lockfile | ||
| working-directory: ./dashboard | ||
|
|
||
| lint-js: | ||
| if: github.event.pull_request.draft != true | ||
| needs: setup-node | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Fetch node_modules | ||
| uses: actions/cache@v4 | ||
| id: fetch-node_modules | ||
| with: | ||
| key: node_modules-${{ runner.os }}-${{ hashFiles('./dashboard/pnpm-lock.yaml') }} | ||
| path: ./dashboard/node_modules | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might be needed on pre-commit run? |
||
| with: | ||
| version: 9.15.2 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: './dashboard/.nvmrc' | ||
|
|
||
| - name: Run eslint | ||
| run: pnpm lint-staged | ||
| working-directory: ./dashboard | ||
|
|
||
| build-front: | ||
| if: github.event.pull_request.draft != true | ||
| needs: setup-node | ||
|
|
@@ -104,7 +93,7 @@ jobs: | |
| run: pnpm build | ||
| working-directory: ./dashboard | ||
|
|
||
| lint-and-unit-test-django: | ||
| unit-test-django: | ||
| if: github.event.pull_request.draft != true | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 3 | ||
|
|
@@ -114,14 +103,6 @@ jobs: | |
| - name: Setup Backend | ||
| uses: ./.github/actions/setup-backend | ||
|
|
||
| - name: Check Lint | ||
| run: poetry run ruff check . | ||
| working-directory: ./backend | ||
|
|
||
| - name: Check Format | ||
| run: poetry run ruff format --check . | ||
| working-directory: ./backend | ||
|
|
||
| - name: Run unit tests with coverage | ||
| run: | | ||
| poetry run pytest -m unit --cov=kernelCI_app --cov=kernelCI_cache --cov-report=term-missing | ||
|
|
@@ -220,7 +201,7 @@ jobs: | |
|
|
||
| # Call job in a a split file | ||
| call-deploy-staging: | ||
| needs: [lint-js, build-front, lint-and-unit-test-django, integration-test-django] | ||
| needs: [pre-commit-checks, build-front, unit-test-django, integration-test-django] | ||
| # This 'if' ensures it only runs on pushes to main (the production requirement) | ||
| if: github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | ||
| uses: ./.github/workflows/deploy-staging.yaml | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.