52 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: Unit test
 | |
| on: [workflow_call]
 | |
| 
 | |
| jobs:
 | |
|   test:
 | |
|     runs-on: ubuntu-latest
 | |
|     strategy:
 | |
|       fail-fast: false
 | |
|       matrix:
 | |
|         python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
 | |
| 
 | |
|     steps:
 | |
|     - uses: actions/checkout@v4
 | |
|       with:
 | |
|         fetch-depth: 0
 | |
|     - name: Set up Python ${{ matrix.python-version }}
 | |
|       uses: actions/setup-python@v5
 | |
|       with:
 | |
|         python-version: ${{ matrix.python-version }}
 | |
|     - name: Get pip cache dir
 | |
|       id: pip-cache
 | |
|       run: |
 | |
|         echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
 | |
|     - name: pip cache
 | |
|       uses: actions/cache@v4
 | |
|       with:
 | |
|         path: ${{ steps.pip-cache.outputs.dir }}
 | |
|         key: pip-${{ matrix.python-version }}-${{ hashFiles('**/setup.cfg') }}
 | |
|     - name: Update pip
 | |
|       run: |
 | |
|         python -m pip install --upgrade pip
 | |
|     - name: Install project dependencies
 | |
|       run: |
 | |
|         pip install -r requirements-dev.txt
 | |
|         pip install pytest-cov
 | |
|         pip install pytest-github-actions-annotate-failures
 | |
|     - name: Download Docker dependencies
 | |
|       # This happens automatically during test execution
 | |
|       # However, our tests can run concurrently
 | |
|       # Which means that our tests can pull this image concurrently
 | |
|       # Pulling it once is more efficient
 | |
|       run: |
 | |
|         docker pull mlupin/docker-lambda:python3.11
 | |
|     - name: Test with pytest
 | |
|       run: |
 | |
|         make test-only
 | |
|     - name: "Upload coverage to Codecov"
 | |
|       if: ${{ github.repository == 'getmoto/moto'}}
 | |
|       uses: codecov/codecov-action@v4
 | |
|       with:
 | |
|         fail_ci_if_error: false
 | |
|         flags: unittests |