make Python CI reusable
This commit is contained in:
		
							
								
								
									
										12
									
								
								.github/workflows/ci-python.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								.github/workflows/ci-python.yml
									
									
									
									
										vendored
									
									
								
							@@ -2,9 +2,6 @@ name: Python CI
 | 
			
		||||
on:
 | 
			
		||||
  workflow_call:
 | 
			
		||||
 | 
			
		||||
# env:
 | 
			
		||||
#   REPO_NAME: 
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  ci:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
@@ -18,16 +15,19 @@ jobs:
 | 
			
		||||
        with:
 | 
			
		||||
          python-version: "3.11"
 | 
			
		||||
      - name: Install dependencies
 | 
			
		||||
        run: pip install -r requirements.txt && pip install -r requirements-dev.txt
 | 
			
		||||
        run: |
 | 
			
		||||
          pip install -r requirements.txt
 | 
			
		||||
          pip install -r requirements-dev.txt
 | 
			
		||||
          pip install pylint-exit
 | 
			
		||||
      - name: Lint
 | 
			
		||||
        run: pylint --recursive=yes --output-format=parseable --output=lintreport.txt . || pylint-exit $?
 | 
			
		||||
      - name: Unit Test
 | 
			
		||||
        run: |
 | 
			
		||||
          coverage run -m py.test -v --junitxml=testresults.xml
 | 
			
		||||
          coverage xml
 | 
			
		||||
# sed -i 's/\/home\/runner\/work\/pypilot\/pypilot/\/github\/workspace/g' coverage.xml
 | 
			
		||||
          sed -i 's@${{ github.workspace }}@/github/workspace@g' coverage.xml
 | 
			
		||||
      - name: SonarCloud Scan
 | 
			
		||||
        uses: SonarSource/sonarcloud-github-action@master
 | 
			
		||||
        env:
 | 
			
		||||
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
 | 
			
		||||
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
			
		||||
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CLOUD }}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user