Skip to content

Commit

Permalink
Add caching to CI. (quantumlib#4999)
Browse files Browse the repository at this point in the history
* Add caching to CI.

* Fix windows caching issues.
  • Loading branch information
MichaelBroughton authored and 95-martin-orion committed Mar 2, 2022
1 parent b6fa6b8 commit a224793
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,13 @@ jobs:
- name: Force old pip (3.6 only)
if: matrix.python-version == '3.6'
run: pip install pip==20.2
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}
- name: Install requirements
run: |
pip install -r dev_tools/requirements/dev.env.txt
pip install --upgrade --upgrade-strategy eager -r dev_tools/requirements/dev.env.txt
- name: Run Quil dependencies
run: docker-compose -f cirq-rigetti/docker-compose.test.yaml up -d
- name: Pytest check
Expand Down Expand Up @@ -208,8 +212,12 @@ jobs:
with:
python-version: '3.8'
architecture: 'x64'
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}
- name: Install requirements
run: pip install -r dev_tools/requirements/dev.env.txt
run: pip install --upgrade --upgrade-strategy eager -r dev_tools/requirements/dev.env.txt
- name: Run Quil dependencies
run: docker-compose -f cirq-rigetti/docker-compose.test.yaml up -d
- name: Coverage check
Expand All @@ -228,10 +236,16 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}
- name: Install requirements
run: pip install -r dev_tools/requirements/no-contrib.env.txt
run: pip install --upgrade --upgrade-strategy eager -r dev_tools/requirements/no-contrib.env.txt
- name: Pytest Windows
run: check/pytest --ignore=cirq-core/cirq/contrib --actually-quiet
run: |
source dev_tools/pypath
check/pytest --ignore=cirq-core/cirq/contrib --actually-quiet
shell: bash
macos:
name: Pytest MacOS
Expand All @@ -245,8 +259,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
- uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev-requirements.txt') }}
- name: Install requirements
run: pip install -r dev_tools/requirements/no-contrib.env.txt
run: pip install --upgrade --upgrade-strategy eager -r dev_tools/requirements/no-contrib.env.txt
- name: Pytest check
run: check/pytest --ignore=cirq-core/cirq/contrib
notebooks-stable:
Expand Down
4 changes: 2 additions & 2 deletions cirq-rigetti/docker-compose.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3'

services:
quilc:
image: rigetti/quilc
image: rigetti/quilc:1.23.0
command: -S
expose:
- "5555"
Expand All @@ -12,7 +12,7 @@ services:
- test

qvm:
image: rigetti/qvm
image: rigetti/qvm:1.17.1
command: -S
expose:
- "5000"
Expand Down
2 changes: 1 addition & 1 deletion dev_tools/pypath
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fi

_PYPATH_PREFIX="${_PYPATH_BASE_DIR}$(
cd "${_PYPATH_BASE_DIR}" &&
env PYTHONPATH=. python3 dev_tools/modules.py list --mode folder |
env PYTHONPATH=. python dev_tools/modules.py list --mode folder |
xargs printf ":${_PYPATH_BASE_DIR}/%s"
)"

Expand Down

0 comments on commit a224793

Please sign in to comment.