From 2fa8b9d35934a5bda97bd69e3ba84780f3b13431 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 28 Jul 2020 00:13:10 -0400 Subject: [PATCH] tweak github actions CI caching --- .github/workflows/test.yml | 52 +++++++++++++------------------------- 1 file changed, 18 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 338e197b..17431678 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,8 +3,7 @@ on: [push] env: MAX_LINE_LENGTH: 110 - PIPENV_VENV_IN_PROJECT: 1 - CACHE_PATH: .venv + jobs: lint: runs-on: ubuntu-latest @@ -17,32 +16,18 @@ jobs: python-version: 3.8 architecture: x64 - - name: Install pipenv - run: | - pip install pipenv - - - uses: actions/cache@v2 - id: cache-archivebox - with: - path: ${{ env.CACHE_PATH }} - key: ${{ runner.os }}-3.8-pipenv-${{ hashFiles('**/Pipfile') }} - restore-keys: | - ${{ runner.os }}-3.8-pipenv- - - - name: Install dependencies - run: | - pipenv install --dev - - name: Lint with flake8 run: | + pip install flake8 # one pass for show-stopper syntax errors or undefined names - pipenv run flake8 archivebox --count --show-source --statistics + flake8 archivebox --count --show-source --statistics # one pass for small stylistic things - pipenv run flake8 archivebox --count --max-line-length="$MAX_LINE_LENGTH" --statistics + flake8 archivebox --count --max-line-length="$MAX_LINE_LENGTH" --statistics - - name: Lint with mypy - run: | - pipenv run mypy archivebox || true + # - name: Lint with mypy + # run: | + # pip install mypy + # mypy archivebox || true test: runs-on: ${{ matrix.os }} @@ -63,25 +48,22 @@ jobs: python-version: ${{ matrix.python }} architecture: x64 - - name: Install pipenv - run: | - pip install pipenv - - - uses: actions/cache@v1 - id: cache-archivebox + - name: Cache virtualenv + uses: actions/cache@v2 with: - path: ${{ env.CACHE_PATH }} - key: ${{ runner.os }}-${{ matrix.python }}-pipenv-${{ hashFiles('**/Pipfile') }} + path: .venv + key: ${{ runner.os }}-${{ matrix.python }}-venv-${{ hashFiles('setup.py') }} restore-keys: | - ${{ runner.os }}-${{ matrix.python }}-pipenv- + ${{ runner.os }}-${{ matrix.python }}-venv- - name: Install dependencies run: | - pipenv install --dev + python3 -m .venv + ./.venv/bin/python -m pip install -e '.[dev]' - name: Test built package with pytest run: | - pipenv run pytest -s + ./.venv/bin/python -m pipenv run pytest -s docker-test: runs-on: ubuntu-latest @@ -91,6 +73,8 @@ jobs: with: fetch-depth: 1 + - uses: satackey/action-docker-layer-caching@v0.0.4 + - name: Build image run: | docker build . -t archivebox