docs/buttons: edit styleguide #376
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: 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: ESLint check | |
run: | | |
ROOT=$(pwd) | |
cd ./packages/core | |
pnpm lint --format json -o $ROOT/eslint_${{ matrix.branch }}.json | |
cd $ROOT | |
- name: Upload eslint_${{ matrix.branch }}.json | |
uses: actions/upload-artifact@v4 | |
with: | |
name: eslint_${{ matrix.branch }} | |
path: 'eslint_${{ matrix.branch }}.json' | |
- name: TSC Check | |
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: Download eslint error json for main branch | |
uses: actions/download-artifact@v4 | |
with: | |
name: eslint_main | |
- name: Download eslint error json for pr branch | |
uses: actions/download-artifact@v4 | |
with: | |
name: eslint_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 |