chore: added lingint
This commit is contained in:
		
							parent
							
								
									eb656dbab6
								
							
						
					
					
						commit
						17174c2a32
					
				
					 2 changed files with 91 additions and 5 deletions
				
			
		
							
								
								
									
										31
									
								
								.github/workflows/lint-monorepo.yaml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										31
									
								
								.github/workflows/lint-monorepo.yaml
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -2,9 +2,18 @@ name: Linting and type checking (monorepo)
 | 
				
			||||||
on:
 | 
					on:
 | 
				
			||||||
  workflow_call:
 | 
					  workflow_call:
 | 
				
			||||||
    inputs:
 | 
					    inputs:
 | 
				
			||||||
      PACKAGE_WRITER_USERNAME:
 | 
					      SONARQUBE_ENABLED:
 | 
				
			||||||
        required: true
 | 
					        required: false
 | 
				
			||||||
 | 
					        type: boolean
 | 
				
			||||||
 | 
					        default: false
 | 
				
			||||||
 | 
					      TESTS_ENABLED:
 | 
				
			||||||
 | 
					        required: false
 | 
				
			||||||
 | 
					        type: boolean
 | 
				
			||||||
 | 
					        default: false
 | 
				
			||||||
 | 
					      SETUP_REPO_SCRIPT:
 | 
				
			||||||
 | 
					        required: false
 | 
				
			||||||
        type: string
 | 
					        type: string
 | 
				
			||||||
 | 
					        default: yarn run setup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
  linting_type_checking:
 | 
					  linting_type_checking:
 | 
				
			||||||
| 
						 | 
					@ -32,14 +41,26 @@ jobs:
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          yarn install --immutable --inline-builds
 | 
					          yarn install --immutable --inline-builds
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Build packages
 | 
					      - name: Setup repostitory
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          yarn run build:packages
 | 
					          ${{ inputs.SETUP_REPO_SCRIPT }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Lint source code (eslint)
 | 
					      - name: Lint source code (eslint)
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          yarn run lint
 | 
					          yarn run lint --max-warnings=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Static type checking (TypeScript)
 | 
					      - name: Static type checking (TypeScript)
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          yarn run check-types
 | 
					          yarn run check-types
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Run tests
 | 
				
			||||||
 | 
					        if: ${{ inputs.TESTS_ENABLED == true }}
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          yarn run test --ci --passWithNoTests --coverage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Static code analysis with SonarQube
 | 
				
			||||||
 | 
					        uses: https://github.com/SonarSource/sonarqube-scan-action@v5
 | 
				
			||||||
 | 
					        if: ${{ inputs.SONARQUBE_ENABLED == true }}
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
 | 
				
			||||||
 | 
					          SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										65
									
								
								.github/workflows/lint-standalone.yaml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								.github/workflows/lint-standalone.yaml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,65 @@
 | 
				
			||||||
 | 
					name: Linting and type checking (standalone)
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  workflow_call:
 | 
				
			||||||
 | 
					    inputs:
 | 
				
			||||||
 | 
					      SONARQUBE_ENABLED:
 | 
				
			||||||
 | 
					        required: false
 | 
				
			||||||
 | 
					        type: boolean
 | 
				
			||||||
 | 
					        default: false
 | 
				
			||||||
 | 
					      TESTS_ENABLED:
 | 
				
			||||||
 | 
					        required: false
 | 
				
			||||||
 | 
					        type: boolean
 | 
				
			||||||
 | 
					        default: false
 | 
				
			||||||
 | 
					      SETUP_REPO_SCRIPT:
 | 
				
			||||||
 | 
					        required: false
 | 
				
			||||||
 | 
					        type: string
 | 
				
			||||||
 | 
					        default: yarn run setup
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  linting_type_checking:
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    env:
 | 
				
			||||||
 | 
					      NO_YARN_POSTINSTALL: 1
 | 
				
			||||||
 | 
					      FONTAWESOME_PACKAGE_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - name: Checkout repository
 | 
				
			||||||
 | 
					        uses: actions/checkout@v5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up Node.js and Corepack
 | 
				
			||||||
 | 
					        uses: actions/setup-node@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          node-version: "22"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Enable Corepack
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          corepack enable
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Install dependencies
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          yarn install --immutable --inline-builds
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Setup repostitory
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          ${{ inputs.SETUP_REPO_SCRIPT }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Lint source code (eslint)
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          yarn run lint --max-warnings=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Static type checking (TypeScript)
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          yarn run check-types
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Run tests
 | 
				
			||||||
 | 
					        if: ${{ inputs.TESTS_ENABLED == true }}
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          yarn run test --ci --passWithNoTests --coverage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Static code analysis with SonarQube
 | 
				
			||||||
 | 
					        uses: https://github.com/SonarSource/sonarqube-scan-action@v5
 | 
				
			||||||
 | 
					        if: ${{ inputs.SONARQUBE_ENABLED == true }}
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
 | 
				
			||||||
 | 
					          SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      # TODO add dependency scanning / graph here
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue