summaryrefslogtreecommitdiff
path: root/.github/workflows/primer_comment.yaml
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2022-08-16 09:36:24 +0200
committerJacob Walls <jacobtylerwalls@gmail.com>2022-08-16 21:49:32 -0400
commit39f0e30547f7d6de849c71ef6cb7fe1ec8b57ca0 (patch)
treecac8fa0bda9f0f78377d6daa5144385fa0ab7101 /.github/workflows/primer_comment.yaml
parent750e3602d268d18d9938904d8f6dae118ca5e0db (diff)
downloadpylint-git-39f0e30547f7d6de849c71ef6cb7fe1ec8b57ca0.tar.gz
Make sure only ``main`` can create the primer virtual environment
Diffstat (limited to '.github/workflows/primer_comment.yaml')
-rw-r--r--.github/workflows/primer_comment.yaml23
1 files changed, 7 insertions, 16 deletions
diff --git a/.github/workflows/primer_comment.yaml b/.github/workflows/primer_comment.yaml
index ff596a6dc..f39ba60aa 100644
--- a/.github/workflows/primer_comment.yaml
+++ b/.github/workflows/primer_comment.yaml
@@ -13,6 +13,7 @@ on:
- completed
env:
+ # This needs to be the SAME as in the Main and PR job
CACHE_VERSION: 20
permissions:
@@ -39,29 +40,19 @@ jobs:
python-version: "3.10"
# Restore cached Python environment
- - name: Generate partial Python venv restore key
- id: generate-python-key
- run: >-
- echo "::set-output name=key::venv-${{ env.CACHE_VERSION }}-${{
- hashFiles('setup.cfg', 'requirements_test.txt', 'requirements_test_min.txt')
- }}"
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v3.0.7
with:
path: venv
- key: >-
- ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
- steps.generate-python-key.outputs.key }}
- restore-keys: |
- ${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{ env.CACHE_VERSION }}-
- - name: Create Python virtual environment
+ key:
+ ${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-primer-${{
+ env.CACHE_VERSION }}
+ - name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
- python -m venv venv
- . venv/bin/activate
- python -m pip install -U pip setuptools wheel
- pip install -U -r requirements_test.txt
+ echo "Failed to restore Python venv from cache"
+ exit 1
- name: Download outputs
uses: actions/github-script@v6