Skip to content

Commit 1f6b6af

Browse files
committed
test more os
1 parent dc0eb5f commit 1f6b6af

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

.github/workflows/all-lints.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ name: Lint Python
55
jobs:
66
lintpython:
77
name: Lint Python
8-
runs-on: ubuntu-20.04
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os: [ubuntu-latest, macos-latest, windows-latest]
12+
python-version: ['3.7', '3.8', '3.9', '3.10']
913
steps:
10-
- name:
11-
uses: actions/setup-python@v2
12-
with:
13-
python-version: 3.9
14-
- run: |
15-
python --version
1614
- uses: actions/checkout@v1
1715
- uses: marian-code/pyaction@master
1816
with:
@@ -26,7 +24,6 @@ jobs:
2624
use-pylint: false
2725
use-flake8: false
2826
use-vulture: true
29-
python-version: "3.6"
30-
- run: |
31-
python --version
27+
python-version: ${{ matrix.python-version }}
28+
3229

README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ steps:
4646
use-mypy: false
4747
use-vulture: true
4848
extra-pylint-options: "--output-format="colorized"
49-
conda-python-version: "3.7"
49+
python-version: "3.7"
5050
```
5151
5252
## Details
5353
54-
Uses conda environment with user selected python version. Only python `3.6` - `3.9`
55-
version are tested since they are by far most common now. Other python `3.x` versions
56-
should also work. Any python `2.x` versions are unsupported!
54+
Uses `actions/setup-python@v2`. Only python `3.6` - `3.10` version are tested since
55+
they are by far most common now. Other python `3.x` versions should also work.
56+
Any python `2.x` versions are unsupported!
5757

5858
The lintner versions are:
5959

@@ -70,12 +70,15 @@ isort==isort-5.7.0
7070

7171
## IMPORTANT - test environment
7272

73-
The python version you set up in your action script with `actions/setup-python@v2`
74-
or by other means will not affect the linting process. The python version used by
75-
the linters can be set up only by `conda-python-version` argument! This also means
76-
that if you modify the system conda environment it might affect the lintnig process.
77-
So it is best to keep the lintnig action separated from others. It is also recomended
78-
to run this on `ubuntu-latest`. Example:
73+
The python version is set by `actions/setup-python@v2` using composite actions. This
74+
means that the the action will change python you might have previously set with
75+
`actions/setup-python@v2`. There are two ways to circumvent this.
76+
77+
- Keep the lintnig action separated from others
78+
- Use it at the and of your workflow when the change in python version will not
79+
affect anything else
80+
81+
Example:
7982

8083
```yml
8184
on:
@@ -85,9 +88,15 @@ name: Lint Python
8588
jobs:
8689
lintpython:
8790
name: Lint Python
88-
runs-on: ubuntu-20.04
91+
runs-on: ubuntu-latest
8992
steps:
9093
- uses: actions/checkout@v1
94+
- uses: actions/setup-python@v2
95+
with:
96+
python-version: 3.9
97+
- run: |
98+
python --version # this will output 3.9 now
99+
run tests or other things using python ...
91100
- uses: marian-code/pyaction@v2
92101
with:
93102
python-root-list: "./tests/*.py"
@@ -100,7 +109,9 @@ jobs:
100109
use-pylint: false
101110
use-flake8: false
102111
use-vulture: true
103-
conda-python-version: "3.8"
112+
python-version: "3.7"
113+
- run: |
114+
python --version # this will output 3.7 now !!!
104115
```
105116

106117
## License

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ inputs:
8080
runs:
8181
using: "composite"
8282
steps:
83-
- name:
83+
- name: Setup python
8484
uses: actions/setup-python@v2
8585
with:
8686
python-version: ${{ inputs.python-version }}

0 commit comments

Comments
 (0)