-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(workflow/strict-check): add workflow to check new errors (#1324)
Co-authored-by: Lukas Maurer <[email protected]>
- Loading branch information
1 parent
47d2fe9
commit 9ef6dac
Showing
6 changed files
with
23,213 additions
and
32 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: Strict check | ||
|
||
on: | ||
pull_request_target: | ||
branches: | ||
- '**' | ||
|
||
# Check is not necessary after strict is true IX-1332 | ||
jobs: | ||
strict_check: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
strategy: | ||
matrix: | ||
branch: ['main', 'pr'] | ||
name: 'Get strictNullChecks errors on ${{ matrix.branch }}' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout main | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: main | ||
if: ${{ matrix.branch == 'main' }} | ||
|
||
- name: Checkout PR branch | ||
uses: actions/checkout@v4 # v4.1.6 | ||
with: | ||
ref: ${{ github.event_name == 'pull_request_target' && format('refs/pull/{0}/merge', github.event.number) || '' }} | ||
persist-credentials: false | ||
if: ${{ matrix.branch == 'pr' }} | ||
|
||
- uses: ./.github/workflows/actions/turbo | ||
|
||
- name: Install tsc-output-parser | ||
run: | | ||
ROOT=$(pwd) | ||
npm install -g @aivenio/[email protected] | ||
cd ./packages/core | ||
npx tsc --strictNullChecks --strictPropertyInitialization --noEmit --pretty false | npx tsc-output-parser > $ROOT/strict_${{ matrix.branch }}.json | ||
cd $ROOT | ||
- name: Upload strict_${{ matrix.branch }}.json | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: strict_${{ matrix.branch }} | ||
path: 'strict_${{ matrix.branch }}.json' | ||
|
||
comment_on_pr: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
needs: ['strict_check'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event_name == 'pull_request_target' && format('refs/pull/{0}/merge', github.event.number) || '' }} | ||
persist-credentials: false | ||
|
||
- uses: ./.github/workflows/actions/turbo | ||
|
||
- name: Download strict error json for main branch | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: strict_main | ||
|
||
- name: Download strict error json for pr branch | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: strict_pr | ||
|
||
- name: Set comment body | ||
id: report-body | ||
run: pnpm ts-run scripts/strict-check.ts | ||
|
||
- name: Find Comment | ||
uses: peter-evans/find-comment@v3 | ||
id: find-comment | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: '### Report of `strictNullChecks (strictPropertyInitialization)` check' | ||
|
||
- name: Create or update comment | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
comment-id: ${{ steps.find-comment.outputs.comment-id }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: ${{ steps.report-body.outputs.body }} | ||
edit-mode: replace |
Oops, something went wrong.