Merge pull request #411 from cdvv7788/gh-actions-issue

fix: Use pip cache instead of venv folder
This commit is contained in:
Nick Sweeting 2020-08-01 11:54:30 -04:00 committed by GitHub
commit 08422da569
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,11 +27,6 @@ jobs:
# one pass for small stylistic things # one pass for small stylistic things
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: |
# pip install mypy
# mypy archivebox || true
test: test:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -51,31 +46,22 @@ jobs:
python-version: ${{ matrix.python }} python-version: ${{ matrix.python }}
architecture: x64 architecture: x64
- name: Cache virtualenv - name: Cache pip
uses: actions/cache@v2 uses: actions/cache@v2
id: cache-venv id: cache-pip
with: with:
path: .venv path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python }}-venv-${{ hashFiles('setup.py') }} key: ${{ runner.os }}-${{ matrix.python }}-venv-${{ hashFiles('setup.py') }}
restore-keys: | restore-keys: |
${{ runner.os }}-${{ matrix.python }}-venv- ${{ runner.os }}-${{ matrix.python }}-venv-
- name: Create virtualenv
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip setuptools
- name: Install dependencies - name: Install dependencies
run: | run: |
source .venv/bin/activate
python -m pip install . python -m pip install .
python -m pip install pytest bottle python -m pip install pytest bottle
- name: Test built package with pytest - name: Test built package with pytest
run: | run: |
source .venv/bin/activate
python -m pytest -s python -m pytest -s
docker-test: docker-test:
@ -115,7 +101,6 @@ jobs:
docker run -v "$PWD"/data:/data archivebox list | grep -q "www.test-nginx-1.local" || { echo "The site 1 isn't in the list"; exit 1; } docker run -v "$PWD"/data:/data archivebox list | grep -q "www.test-nginx-1.local" || { echo "The site 1 isn't in the list"; exit 1; }
docker run -v "$PWD"/data:/data archivebox list | grep -q "www.test-nginx-2.local" || { echo "The site 2 isn't in the list"; exit 1; } docker run -v "$PWD"/data:/data archivebox list | grep -q "www.test-nginx-2.local" || { echo "The site 2 isn't in the list"; exit 1; }
- name: Start docker-compose stack - name: Start docker-compose stack
run: | run: |
docker-compose run archivebox init docker-compose run archivebox init