mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-04 03:27:12 -05:00 
			
		
		
		
	Merge pull request #296 from stumpylog/ci-cache-venv
Updates actions to use GHA Python pipenv caching
This commit is contained in:
		
						commit
						3264015dac
					
				
							
								
								
									
										70
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										70
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							@ -18,32 +18,25 @@ jobs:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
      -
 | 
			
		||||
        name: Install pipenv
 | 
			
		||||
        run: pipx install pipenv
 | 
			
		||||
      -
 | 
			
		||||
        name: Set up Python
 | 
			
		||||
        uses: actions/setup-python@v2
 | 
			
		||||
        with:
 | 
			
		||||
          python-version: 3.9
 | 
			
		||||
      -
 | 
			
		||||
        name: Get pip cache dir
 | 
			
		||||
        id: pip-cache
 | 
			
		||||
        run: |
 | 
			
		||||
          echo "::set-output name=dir::$(pip cache dir)"
 | 
			
		||||
      -
 | 
			
		||||
        name: Persistent Github pip cache
 | 
			
		||||
        uses: actions/cache@v2
 | 
			
		||||
        with:
 | 
			
		||||
          path: ${{ steps.pip-cache.outputs.dir }}
 | 
			
		||||
          key: ${{ runner.os }}-pip3.8}
 | 
			
		||||
          cache: "pipenv"
 | 
			
		||||
          cache-dependency-path: 'Pipfile.lock'
 | 
			
		||||
      -
 | 
			
		||||
        name: Install dependencies
 | 
			
		||||
        run: |
 | 
			
		||||
          pip install --upgrade pipenv
 | 
			
		||||
          pipenv install --system --dev --ignore-pipfile
 | 
			
		||||
          pipenv sync --dev
 | 
			
		||||
      -
 | 
			
		||||
        name: Make documentation
 | 
			
		||||
        run: |
 | 
			
		||||
          cd docs/
 | 
			
		||||
          make html
 | 
			
		||||
          pipenv run make html
 | 
			
		||||
      -
 | 
			
		||||
        name: Upload artifact
 | 
			
		||||
        uses: actions/upload-artifact@v2
 | 
			
		||||
@ -57,32 +50,25 @@ jobs:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
      -
 | 
			
		||||
        name: Install pipenv
 | 
			
		||||
        run: pipx install pipenv
 | 
			
		||||
      -
 | 
			
		||||
        name: Set up Python
 | 
			
		||||
        uses: actions/setup-python@v2
 | 
			
		||||
        with:
 | 
			
		||||
          python-version: 3.9
 | 
			
		||||
      -
 | 
			
		||||
        name: Get pip cache dir
 | 
			
		||||
        id: pip-cache
 | 
			
		||||
        run: |
 | 
			
		||||
          echo "::set-output name=dir::$(pip cache dir)"
 | 
			
		||||
      -
 | 
			
		||||
        name: Persistent Github pip cache
 | 
			
		||||
        uses: actions/cache@v2
 | 
			
		||||
        with:
 | 
			
		||||
          path: ${{ steps.pip-cache.outputs.dir }}
 | 
			
		||||
          key: ${{ runner.os }}-pip${{ matrix.python-version }}
 | 
			
		||||
          cache: "pipenv"
 | 
			
		||||
          cache-dependency-path: 'Pipfile.lock'
 | 
			
		||||
      -
 | 
			
		||||
        name: Install dependencies
 | 
			
		||||
        run: |
 | 
			
		||||
          pip install --upgrade pipenv
 | 
			
		||||
          pipenv install --system --dev --ignore-pipfile
 | 
			
		||||
          pipenv sync --dev
 | 
			
		||||
      -
 | 
			
		||||
        name: Codestyle
 | 
			
		||||
        run: |
 | 
			
		||||
          cd src/
 | 
			
		||||
          pycodestyle --max-line-length=88 --ignore=E121,E123,E126,E226,E24,E704,W503,W504,E203
 | 
			
		||||
          pipenv run pycodestyle --max-line-length=88 --ignore=E121,E123,E126,E226,E24,E704,W503,W504,E203
 | 
			
		||||
  codeformatting:
 | 
			
		||||
    runs-on: ubuntu-20.04
 | 
			
		||||
    steps:
 | 
			
		||||
@ -106,34 +92,30 @@ jobs:
 | 
			
		||||
      -
 | 
			
		||||
        name: Checkout
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
      -
 | 
			
		||||
        name: Install pipenv
 | 
			
		||||
        run: pipx install pipenv
 | 
			
		||||
      -
 | 
			
		||||
        name: Set up Python
 | 
			
		||||
        uses: actions/setup-python@v2
 | 
			
		||||
        with:
 | 
			
		||||
          python-version: "${{ matrix.python-version }}"
 | 
			
		||||
          cache: "pipenv"
 | 
			
		||||
          cache-dependency-path: 'Pipfile.lock'
 | 
			
		||||
      -
 | 
			
		||||
        name: Get pip cache dir
 | 
			
		||||
        id: pip-cache
 | 
			
		||||
        run: |
 | 
			
		||||
          echo "::set-output name=dir::$(pip cache dir)"
 | 
			
		||||
      -
 | 
			
		||||
        name: Persistent Github pip cache
 | 
			
		||||
        uses: actions/cache@v2
 | 
			
		||||
        with:
 | 
			
		||||
          path: ${{ steps.pip-cache.outputs.dir }}
 | 
			
		||||
          key: ${{ runner.os }}-pip${{ matrix.python-version }}
 | 
			
		||||
      -
 | 
			
		||||
        name: Install dependencies
 | 
			
		||||
        name: Install system dependencies
 | 
			
		||||
        run: |
 | 
			
		||||
          sudo apt-get update -qq
 | 
			
		||||
          sudo apt-get install -qq --no-install-recommends unpaper tesseract-ocr imagemagick ghostscript optipng
 | 
			
		||||
          pip install --upgrade pipenv
 | 
			
		||||
          pipenv install --system --dev --ignore-pipfile
 | 
			
		||||
      -
 | 
			
		||||
        name: Install Python dependencies
 | 
			
		||||
        run: |
 | 
			
		||||
          pipenv sync --dev
 | 
			
		||||
      -
 | 
			
		||||
        name: Tests
 | 
			
		||||
        run: |
 | 
			
		||||
          cd src/
 | 
			
		||||
          pytest
 | 
			
		||||
          pipenv run pytest
 | 
			
		||||
      -
 | 
			
		||||
        name: Publish coverage results
 | 
			
		||||
        if: matrix.python-version == '3.9'
 | 
			
		||||
@ -142,7 +124,7 @@ jobs:
 | 
			
		||||
        # https://github.com/coveralls-clients/coveralls-python/issues/251
 | 
			
		||||
        run: |
 | 
			
		||||
          cd src/
 | 
			
		||||
          coveralls --service=github
 | 
			
		||||
          pipenv run coveralls --service=github
 | 
			
		||||
 | 
			
		||||
  # build and push image to docker hub.
 | 
			
		||||
  build-docker-image:
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user