12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- name: "Frontend: PR/master build & test"
- on:
- push:
- branches:
- - master
- pull_request_target:
- types: ["opened", "edited", "reopened", "synchronize"]
- paths:
- - "kafka-ui-contract/**"
- - "kafka-ui-react-app/**"
- permissions:
- checks: write
- pull-requests: write
- jobs:
- build-and-test:
- env:
- CI: true
- NODE_ENV: dev
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3
- with:
- # Disabling shallow clone is recommended for improving relevancy of reporting
- fetch-depth: 0
- ref: ${{ github.event.pull_request.head.sha }}
- - uses: pnpm/action-setup@v2.4.0
- with:
- version: 8.6.12
- - name: Install node
- uses: actions/setup-node@v3.8.1
- with:
- node-version: "18.17.1"
- cache: "pnpm"
- cache-dependency-path: "./kafka-ui-react-app/pnpm-lock.yaml"
- - name: Install Node dependencies
- run: |
- cd kafka-ui-react-app/
- pnpm install --frozen-lockfile
- - name: Generate sources
- run: |
- cd kafka-ui-react-app/
- pnpm gen:sources
- - name: Linter
- run: |
- cd kafka-ui-react-app/
- pnpm lint:CI
- - name: Tests
- run: |
- cd kafka-ui-react-app/
- pnpm test:CI
- - name: SonarCloud Scan
- uses: sonarsource/sonarcloud-github-action@master
- with:
- projectBaseDir: ./kafka-ui-react-app
- args: -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} -Dsonar.pullrequest.branch=${{ github.head_ref }} -Dsonar.pullrequest.base=${{ github.base_ref }}
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FRONTEND }}
|