summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2023-08-18 14:48:53 +0200
committertoonn <toonn@toonn.io>2023-08-18 14:48:53 +0200
commit0e9ca525063bd529657c9d7653a4f4f35f999128 (patch)
treea01ced5ead6030f9ce10c489428933fd921f9551
parent69a3d21fe4bbaa32e0677276316bc4507e6dea43 (diff)
parentf3e93c79fb783af0490306625a879b175ab82509 (diff)
Merge branch 'gh-actions'
-rw-r--r--.github/workflows/other.yml36
-rw-r--r--.github/workflows/pr.yml39
-rw-r--r--.github/workflows/python.yml (renamed from .github/workflows/pylint.yml)4
3 files changed, 35 insertions, 44 deletions
diff --git a/.github/workflows/other.yml b/.github/workflows/other.yml
deleted file mode 100644
index 06c90db6..00000000
--- a/.github/workflows/other.yml
+++ /dev/null
@@ -1,36 +0,0 @@
-name: Other tests
-
-on: [push, pull_request]
-
-jobs:
- test_py:
- runs-on: ubuntu-latest
- strategy:
- max-parallel: 4
- matrix:
- python-version: [2.7, 3.7, 3.x]
- env:
- TERM: dumb
- steps:
- - uses: actions/checkout@v3
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v4
- with:
- python-version: ${{ matrix.python-version }}
- - name: Install dependencies
- run: |
- python -m pip install --upgrade pip
- # We need to ignore PyLint because we can't install the one we need for
- # Python 2.7 and 3.5
- pip install -r <(grep -v pylint requirements.txt)
- - name: Get changed Python files
- uses: dorny/paths-filter@v2
- id: paths-filter
- with:
- filters: |
- code:
- - added|modified: '!(ranger/config)**.py'
- - name: Other tests
- if: ${{ steps.path-filter.outputs.code == 'true' }}
- run: |
- make test_doctest test_other
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index 67ae4368..db6f31be 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -3,7 +3,9 @@ name: PR Pylint, PEP8 and Pytest
on: pull_request
jobs:
- test_pylint:
+ test_PR:
+ env:
+ TERM: xterm
runs-on: ubuntu-latest
strategy:
max-parallel: 4
@@ -25,22 +27,47 @@ jobs:
with:
list-files: 'shell'
filters: |
+ this-workflow:
+ - modified: '.github/workflows/pr.yml'
code:
- added|modified: '!(ranger/config)**.py'
config:
- added|modified: 'ranger/config/**.py'
- - name: Lint code with Flake8 and Pylint
- if: ${{ steps.path-filter.outputs.code == 'true' }}
+ - name: Lint changed code with Flake8 and Pylint
+ if: steps.paths-filter.outputs.code == 'true'
+ && steps.paths-filter.outputs.this-workflow == 'false'
run: |
flake8 ${{ steps.paths-filter.outputs.code_files }}
pylint ${{ steps.paths-filter.outputs.code_files }}
- - name: Lint config with Flake8 and Pylint
- if: ${{ steps.path-filter.outputs.config == 'true' }}
+ - name: Lint all code with Flake8 and Pylint
+ if: steps.paths-filter.outputs.this-workflow == 'true'
+ run: |
+ make TEST_PATHS_CONFIG= test_flake8
+ make TEST_PATHS_CONFIG=--version test_pylint
+ - name: Lint changed config with Flake8 and Pylint
+ if: steps.paths-filter.outputs.config == 'true'
+ && steps.paths-filter.outputs.this-workflow == 'false'
run: |
flake8 ${{ steps.paths-filter.outputs.config }}
pylint --rcfile=ranger/config/.pylintrc \
${{ steps.paths-filter.outputs.config_files }}
+ - name: Lint all config with Flake8 and Pylint
+ if: steps.paths-filter.outputs.this-workflow == 'true'
+ run: |
+ make TEST_PATHS_MAIN= test_flake8
+ make TEST_PATHS_MAIN=--version test_pylint
+ - name: Run doctest
+ if: steps.paths-filter.outputs.code == 'true'
+ || steps.paths-filter.outputs.this-workflow == 'true'
+ run: |
+ make test_doctest
- name: Test code with Pytest
- if: ${{ steps.path-filter.outputs.code == 'true' }}
+ if: steps.paths-filter.outputs.code == 'true'
+ || steps.paths-filter.outputs.this-workflow == 'true'
run: |
make test_pytest
+ - name: Check man page completeness
+ if: steps.paths-filter.outputs.code == 'true'
+ || steps.paths-filter.outputs.this-workflow == 'true'
+ run: |
+ make test_other
diff --git a/.github/workflows/pylint.yml b/.github/workflows/python.yml
index a7bf5c2a..dd872ba8 100644
--- a/.github/workflows/pylint.yml
+++ b/.github/workflows/python.yml
@@ -1,4 +1,4 @@
-name: Pylint, PEP8 and Pytest
+name: Python linting and tests
on:
push:
@@ -26,4 +26,4 @@ jobs:
pip install -r requirements.txt
- name: Lint with Flake8 and Pylint, test with Pytest
run: |
- make test_flake8 test_pylint test_pytest
+ make test_py