Add unit test workflow
This commit is contained in:
		
							
								
								
									
										44
									
								
								.github/workflows/unittests.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								.github/workflows/unittests.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,44 @@
 | 
			
		||||
name: Unit Tests
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  push:
 | 
			
		||||
    branches:
 | 
			
		||||
      - master
 | 
			
		||||
      - feature/refactor
 | 
			
		||||
  pull_request: {}
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  test:
 | 
			
		||||
    name: Unit Tests
 | 
			
		||||
    runs-on: ubuntu-22.04
 | 
			
		||||
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        python-version: [3.6, 3.7, 3.8, 3.9, 3.10, 3.11]
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
    - name: Checkout
 | 
			
		||||
      uses: actions/checkout@v3
 | 
			
		||||
 | 
			
		||||
    - name: Set up Python ${{ matrix.python-version }}
 | 
			
		||||
      uses: actions/setup-python@v2
 | 
			
		||||
      with:
 | 
			
		||||
        python-version: ${{ matrix.python-version }}
 | 
			
		||||
        cache: pip
 | 
			
		||||
 | 
			
		||||
    - name: Install dependencies
 | 
			
		||||
      run: |
 | 
			
		||||
        python -m pip install --upgrade pip
 | 
			
		||||
        pip install pytest
 | 
			
		||||
        pip install -r requirements.txt
 | 
			
		||||
 | 
			
		||||
    - name: pytest
 | 
			
		||||
      run: |
 | 
			
		||||
        pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=semver | tee pytest-coverage.txt
 | 
			
		||||
 | 
			
		||||
    - name: Comment Result Summary
 | 
			
		||||
      uses: MishaKav/pytest-coverage-comment@main
 | 
			
		||||
      with:
 | 
			
		||||
        pytest-coverage-path: ./pytest-coverage.txt
 | 
			
		||||
        junitxml-path: ./pytest.xml
 | 
			
		||||
      if: github.event_name == 'pull_request'
 | 
			
		||||
		Reference in New Issue
	
	Block a user