Browse Source

[ENH] update cache in github actions

pull/5/head
Gao Enhao 1 year ago
parent
commit
444eda9195
1 changed files with 7 additions and 10 deletions
  1. +7
    -10
      .github/workflows/build-and-test.yaml

+ 7
- 10
.github/workflows/build-and-test.yaml View File

@@ -21,18 +21,13 @@ jobs:
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}


- name: Cache Python virtual environment
uses: actions/cache@v2
- uses: syphar/restore-virtualenv@v1
id: cache-virtualenv
with: with:
path: |
~/.venv
!~/.venv/*/lib/python*/no-global-site-packages.txt
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-python-${{ matrix.python-version }}-
requirement_files: requirements.txt


- name: Display python version
run: python -c "import sys; print(sys.version)"
- uses: syphar/restore-pip-download-cache@v1
if: steps.cache-virtualenv.outputs.cache-hit != 'true'


- name: Install SWI-Prolog on Ubuntu - name: Install SWI-Prolog on Ubuntu
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
@@ -45,10 +40,12 @@ jobs:
run: brew install swi-prolog run: brew install swi-prolog


- name: Install package dependencies - name: Install package dependencies
if : steps.cache-virtualenv.outputs.cache-hit != 'true'
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install pytest pytest-cov pip install pytest pytest-cov
- name: Install - name: Install
if : steps.cache-virtualenv.outputs.cache-hit != 'true'
run: pip install -v -e . run: pip install -v -e .


- name: Run tests - name: Run tests


Loading…
Cancel
Save