feat(react-components): Add circle and cylinder measurement #16617
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: React Components CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: | |
- "**" | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: read | |
outputs: | |
should-run: ${{ github.event_name != 'pull_request' || steps.filter.outputs.should-run }} | |
steps: | |
# For pull requests it's not necessary to checkout the code | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
filters: | | |
should-run: | |
- '.github/**' | |
- 'react-components/**' | |
react-components-ci: | |
needs: changes | |
if: ${{ needs.changes.outputs.should-run == 'true' }} | |
runs-on: ubuntu-latest | |
environment: CI | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Setup Cognite CICD Yarn | |
working-directory: react-components | |
run: | | |
echo " | |
npmScopes: | |
cognite: | |
npmAlwaysAuth: true | |
npmAuthToken: \"\${NPM_TOKEN}\" | |
npmRegistryServer: "https://registry.npmjs.org" | |
" >> .yarnrc.yml | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_READONLY_TOKEN }} | |
- name: Install NPM dependencies | |
working-directory: react-components | |
run: yarn install --immutable | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_READONLY_TOKEN }} | |
- name: Lint | |
working-directory: react-components | |
continue-on-error: false | |
run: yarn run lint | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_READONLY_TOKEN }} | |
- name: Check circular dependencies | |
working-directory: react-components | |
continue-on-error: false | |
run: yarn run check-circular-deps | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_READONLY_TOKEN }} | |
- name: Typecheck source code | |
working-directory: react-components | |
continue-on-error: false | |
run: yarn run typecheck:source | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_READONLY_TOKEN }} | |
- name: Build components | |
working-directory: react-components | |
continue-on-error: false | |
run: yarn run build | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_READONLY_TOKEN }} | |
- name: Build Storybook | |
working-directory: react-components | |
continue-on-error: false | |
run: yarn run build-storybook | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
- name: Typecheck test code | |
working-directory: react-components | |
continue-on-error: false | |
run: yarn run typecheck:test | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_READONLY_TOKEN }} | |
- name: Unit tests | |
working-directory: react-components | |
continue-on-error: false | |
run: yarn run test:coverage | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Install playwright browsers | |
working-directory: react-components | |
continue-on-error: false | |
run: yarn playwright install chromium | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
- name: Visual regression tests | |
working-directory: react-components | |
continue-on-error: false | |
run: yarn run test:playwright | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: react-components/playwright-report/ |