Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade GitHub actions #49

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
44 changes: 22 additions & 22 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Test run action (triggers warnings)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
with:
path: example
Expand All @@ -21,7 +21,7 @@ jobs:
name: Test run action (valid)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
with:
path: example_valid
Expand All @@ -30,7 +30,7 @@ jobs:
name: Test run action (valid with custom Flake8)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: pip install flake8==3.8.0
- uses: ./
with:
Expand All @@ -40,7 +40,7 @@ jobs:
name: Test run action (valid with Flake 3.8.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
with:
path: example_valid
Expand All @@ -50,8 +50,8 @@ jobs:
name: Test run action (valid with Python 3.9)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: ./
Expand All @@ -62,31 +62,31 @@ jobs:
name: Test run action (plugins)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
plugins: flake8-bugbear
path: example_bugbear
only_warn: 1
- uses: actions/checkout@v4
- uses: ./
with:
plugins: flake8-bugbear
path: example_bugbear
only_warn: 1

run_action_with_classes:
name: Test run action (classes)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
plugins: flake8-bugbear
path: example_bugbear
warning_classes: E,F
error_classes: W,B
only_warn: 1
- uses: actions/checkout@v4
- uses: ./
with:
plugins: flake8-bugbear
path: example_bugbear
warning_classes: E,F
error_classes: W,B
only_warn: 1

run_action_with_extra_arguments:
name: Test run action (extra arguments)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
with:
path: example_length
Expand All @@ -96,7 +96,7 @@ jobs:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
Expand Down
55 changes: 27 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
[![GitHub Tag](https://img.shields.io/github/v/tag/TrueBrain/actions-flake8?include_prereleases&label=stable)](https://github.com/TrueBrain/actions-flake8/releases)
[![GitHub commits since latest release](https://img.shields.io/github/commits-since/TrueBrain/actions-flake8/latest/main)](https://github.com/TrueBrain/actions-flake8/commits/main)

This GitHub Actions runs flake8 over your code.
This GitHub Actions runs [flake8](https://github.com/PyCQA/flake8) over your code.
Any warnings or errors will be annotated in the Pull Request.

## Usage

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
```

By default, it uses the default Python version as installed on the GitHub Runner.

### Different Python version

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: TrueBrain/actions-flake8@v2
Expand All @@ -36,19 +36,19 @@ In some cases you might want to pin a certain flake8 version.

This parameter is optional; by default the latest flake8 will be installed (if no flake8 is installed yet).

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
flake8_version: 3.8.0
flake8_version: 6.1.0
```

Alternatively, you can pre-install flake8 before executing this action:

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: pip install flake8==3.8.0
- uses: TrueBrain/actions-flake8@v2
```
Expand All @@ -62,9 +62,9 @@ This can be useful if your project is more than Python code.

This parameter is optional; by default `flake8` will run on your whole repository.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
path: src
Expand All @@ -76,24 +76,23 @@ Indicates errors and warnings to skip.

This parameter is optional; by default no alerts will be ignored

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
ignore: E4,W
```


### Parameter: max_line_length

Indicates the maximum allowed line length.

This parameter is optional; by default flake8's default line length will be used.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
max_line_length: 90
Expand All @@ -107,9 +106,9 @@ All errors and warnings are annotated in Pull Requests, but it will act like eve

This parameter is optional; setting this to any value will enable it.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
only_warn: 1
Expand All @@ -121,9 +120,9 @@ List of plugins to install before running, This is passed directly to `pip insta

This parameter is optional; setting this to any value will enable it.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
plugins: flake8-bugbear cohesion==0.9.1
Expand All @@ -135,9 +134,9 @@ List of flake8 [error classes](https://flake8.pycqa.org/en/latest/glossary.html#

This parameter is optional; by default `E` and `F` classes will be considered errors.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
error_classes: E,H
Expand All @@ -149,9 +148,9 @@ List of flake8 [error classes](https://flake8.pycqa.org/en/latest/glossary.html#

This parameter is optional; by default all classes not contained in `error_classes` will be considered a warning.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
warning_classes: W,B,D
Expand All @@ -164,9 +163,9 @@ Useful when you need to give an argument this action otherwise doesn't supply (l

This parameter is optional; by default it is empty.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
extra_arguments: "--hang-closing"
Expand Down
Loading