Skip to content

Commit

Permalink
Update CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyWong16 committed Jul 28, 2023
1 parent bb11d50 commit 6a47256
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@ jobs:
with:
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Restore Python ${{ env.DEFAULT_PYTHON }} virtual environment
- name: Restore Python ${{ steps.python.outputs.python-version }} virtual environment
id: cache-venv
uses: actions/[email protected]
with:
path: venv
key: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements_dev.txt') }}
restore-keys: |
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-
${{ steps.python.outputs.python-version }}-
${{ hashFiles('requirements_dev.txt') }}
restore-keys: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-
${{ steps.python.outputs.python-version }}-
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand All @@ -59,7 +60,7 @@ jobs:
pytest:
name: pytest ${{ matrix.python-version }} (${{ matrix.plex }})
name: pytest (${{ matrix.plex }})
needs: lint-flake8
runs-on: ubuntu-latest
env:
Expand All @@ -70,7 +71,6 @@ jobs:
fail-fast: false
max-parallel: 3
matrix:
python-version: [3.8]
plex: ['unclaimed', 'claimed']
is-master:
- ${{ github.ref == 'refs/heads/master' }}
Expand All @@ -81,23 +81,24 @@ jobs:
- name: Check out code from Github
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Restore Python ${{ matrix.python-version }} virtual environment
- name: Restore Python ${{ steps.python.outputs.python-version }} virtual environment
id: cache-venv
uses: actions/[email protected]
with:
path: venv
key: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements_dev.txt') }}
restore-keys: |
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-
${{ steps.python.outputs.python-version }}-
${{ hashFiles('requirements_dev.txt') }}
restore-keys: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-
${{ steps.python.outputs.python-version }}-
- name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -184,7 +185,7 @@ jobs:
- name: Upload coverage artifact
uses: actions/upload-artifact@v3
with:
name: coverage-${{ matrix.plex }}-${{ matrix.python-version }}
name: coverage-${{ matrix.plex }}-${{ steps.python.outputs.python-version }}
path: .coverage


Expand All @@ -211,17 +212,18 @@ jobs:
with:
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Restore Python ${{ env.DEFAULT_PYTHON }} virtual environment
- name: Restore Python ${{ steps.python.outputs.python-version }} virtual environment
id: cache-venv
uses: actions/[email protected]
with:
path: venv
key: >-
${{ env.CACHE_VERSION}}-${{ runner.os }}-venv-${{
steps.python.outputs.python-version }}-${{
hashFiles('requirements_dev.txt') }}
restore-keys: |
${{ env.CACHE_VERSION}}-${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-
${{ steps.python.outputs.python-version }}-
${{ hashFiles('requirements_dev.txt') }}
restore-keys: >-
${{ env.CACHE_VERSION }}-${{ runner.os }}-venv-
${{ steps.python.outputs.python-version }}-
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
Expand Down

0 comments on commit 6a47256

Please sign in to comment.