mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 14:44:18 +00:00
tweak github actions CI caching
This commit is contained in:
parent
6073b454b0
commit
2fa8b9d359
1 changed files with 18 additions and 34 deletions
52
.github/workflows/test.yml
vendored
52
.github/workflows/test.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue