From fbf02bcedd764ec3dd638843acadbfa9ba2c6f68 Mon Sep 17 00:00:00 2001 From: qitianshi <65122416+qitianshi@users.noreply.github.com> Date: Thu, 16 Dec 2021 19:33:30 +0800 Subject: [PATCH 1/5] Reconfigure jobs to use Python venv --- .github/workflows/pylint.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 5ee9c8ad..89667bff 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -1,9 +1,6 @@ name: Pylint -on: - push: - paths: - 'analysis/**' +on: [push] jobs: build: @@ -23,16 +20,15 @@ jobs: id: cache-venv with: path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }} + key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }} + restore-keys: | + ${{ runner.os }}-venv- - - name: Install dependencies + - run: python3 -m venv ./venv && . ./venv/bin/activate && + pip install -r requirements.txt && pip install pylint if: steps.cache-venv.outputs.cache-hit != 'true' - run: | - python -m pip install --upgrade pip - pip install pylint - pip install --upgrade --upgrade-strategy eager -r requirements.txt - name: Analysing the code with pylint # Runs Pylint, disables refactor (R) messages and TODO/FIXME warnings (W0511) run: | - pylint analysis --disable=R --disable=W0511 + ./venv/bin/activate && pylint analysis --disable=R --disable=W0511 From c32208f31669a611d3e54102be96830ae0a84ab0 Mon Sep 17 00:00:00 2001 From: qitianshi <65122416+qitianshi@users.noreply.github.com> Date: Thu, 16 Dec 2021 19:35:25 +0800 Subject: [PATCH 2/5] Fix pylint installation --- .github/workflows/pylint.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 89667bff..8c5153ff 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -25,10 +25,10 @@ jobs: ${{ runner.os }}-venv- - run: python3 -m venv ./venv && . ./venv/bin/activate && - pip install -r requirements.txt && pip install pylint + pip install -r requirements.txt && python3 -m pip install pylint if: steps.cache-venv.outputs.cache-hit != 'true' - name: Analysing the code with pylint # Runs Pylint, disables refactor (R) messages and TODO/FIXME warnings (W0511) run: | - ./venv/bin/activate && pylint analysis --disable=R --disable=W0511 + . ./venv/bin/activate && pylint analysis --disable=R --disable=W0511 From 07e15aec7d15bcd36e2ab029e2c9a4dec8b8b25a Mon Sep 17 00:00:00 2001 From: qitianshi <65122416+qitianshi@users.noreply.github.com> Date: Thu, 16 Dec 2021 19:38:09 +0800 Subject: [PATCH 3/5] Add job names --- .github/workflows/pylint.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 8c5153ff..6d70430d 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -24,11 +24,12 @@ jobs: restore-keys: | ${{ runner.os }}-venv- - - run: python3 -m venv ./venv && . ./venv/bin/activate && + - name: Create Python venv and install dependencies + run: python3 -m venv ./venv && . ./venv/bin/activate && pip install -r requirements.txt && python3 -m pip install pylint if: steps.cache-venv.outputs.cache-hit != 'true' - - name: Analysing the code with pylint + - name: Analysing with pylint # Runs Pylint, disables refactor (R) messages and TODO/FIXME warnings (W0511) run: | . ./venv/bin/activate && pylint analysis --disable=R --disable=W0511 From 7b1c846b33a6ba67de0be275a12832025295f9b4 Mon Sep 17 00:00:00 2001 From: qitianshi <65122416+qitianshi@users.noreply.github.com> Date: Thu, 16 Dec 2021 19:39:54 +0800 Subject: [PATCH 4/5] Fix cache path --- .github/workflows/pylint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 6d70430d..7685721d 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/cache@v2 id: cache-venv with: - path: ${{ env.pythonLocation }} + path: ./venv/ key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements*.txt') }} restore-keys: | ${{ runner.os }}-venv- From f6712c162719f2c03e4f24072cf5361bffc5f0e2 Mon Sep 17 00:00:00 2001 From: qitianshi <65122416+qitianshi@users.noreply.github.com> Date: Thu, 16 Dec 2021 19:45:50 +0800 Subject: [PATCH 5/5] Configure push trigger path --- .github/workflows/pylint.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 7685721d..50b97ad4 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -1,6 +1,9 @@ name: Pylint -on: [push] +on: + push: + paths: + 'analysis/**' jobs: build: