Skip to content

Commit

Permalink
update actions/checkout version
Browse files Browse the repository at this point in the history
actions/checkout@v3 is recommended to support Node.js v16
(Node.js v12 is deprecated in Github action)

Signed-off-by: Inho Oh <[email protected]>
  • Loading branch information
webispy committed Oct 17, 2022
1 parent e605aac commit dbffc5e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .checkpatch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--no-tree
--ignore FILE_PATH_CHANGES
--ignore GERRIT_CHANGE_ID
--ignore GIT_COMMIT_ID
--ignore SPDX_LICENSE_TAG
10 changes: 9 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ jobs:
name: checkpatch review
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Info
run: |
echo "Repository: $GITHUB_REPOSITORY"
echo "Workspace: $GITHUB_WORKSPACE"
pwd
ls -la `pwd`
- name: Run checkpatch review
uses: webispy/checkpatch-action@master
env:
Expand Down
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ jobs:
name: checkpatch review
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run checkpatch review
uses: webispy/checkpatch-action@master
uses: webispy/checkpatch-action@v9
```
For using a custom checkpatch script, pass the `CHECKPATCH_COMMAND` environment
Expand All @@ -46,15 +48,18 @@ jobs:
name: checkpatch review
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run DPDK checkpatches.sh review
uses: webispy/checkpatch-action@master
uses: webispy/checkpatch-action@v9
env:
DPDK_CHECKPATCH_PATH: /usr/bin/checkpatch.pl
CHECKPATCH_COMMAND: ./devtools/checkpatches.sh
```

**Note:** For **private repositories** this action needs access to the `GITHUB_TOKEN`. It needs read access to `contents` and `pull-requests` as minimum permissions. For example:

```yml
name: checkpatch review
on: [pull_request]
Expand All @@ -66,9 +71,11 @@ jobs:
contents: read
pull-requests: read
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Run checkpatch review
uses: webispy/checkpatch-action@master
uses: webispy/checkpatch-action@v9
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
```
Expand All @@ -77,11 +84,11 @@ jobs:

The `checkpatch.pl` tool supports a configuration file for setting options. Just create a `.checkpatch.conf` file in the top-level directory of your project and specify options in it.

https://docs.kernel.org/dev-tools/checkpatch.html#type-descriptions
<https://docs.kernel.org/dev-tools/checkpatch.html#type-descriptions>

#### Example for `.checkpatch.conf` file

```
```text
# This isn't actually a Linux kernel tree
--no-tree
Expand All @@ -104,20 +111,20 @@ https://docs.kernel.org/dev-tools/checkpatch.html#type-descriptions

Following files are used to this project.

- https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl
- https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt
- <https://raw.githubusercontent.com/torvalds/linux/master/scripts/checkpatch.pl>
- <https://raw.githubusercontent.com/torvalds/linux/master/scripts/spelling.txt>

### Patch

#### Add option for excluding directories

From [zephyr](https://github.com/zephyrproject-rtos/zephyr) project:

- https://github.com/zephyrproject-rtos/zephyr/commit/92a12a19ae5ac5fdf441c690c48eed0052df326d
- <https://github.com/zephyrproject-rtos/zephyr/commit/92a12a19ae5ac5fdf441c690c48eed0052df326d>

#### Disable warning for "No structs that should be const ..."

- https://github.com/nugulinux/docker-devenv/blob/bionic/patches/0002-ignore_const_struct_warning.patch
- <https://github.com/nugulinux/docker-devenv/blob/bionic/patches/0002-ignore_const_struct_warning.patch>

### Docker image

Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo "REF: $GITHUB_REF"
echo "HEAD-REF: $GITHUB_HEAD_REF"
echo "BASE-REF: $GITHUB_BASE_REF"
pwd
ls -l `pwd`
ls -la `pwd`
id

# Add safe directory option for github workspace to disable fatal error
Expand Down
2 changes: 1 addition & 1 deletion review.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ do

# The row is started with "#"
if [[ "$row" =~ ^\# ]]; then
# Split the string using ':' seperator
# Split the string using ':' separator
IFS=':' read -r -a list <<< "$row"

# Get file-name after removing spaces.
Expand Down

0 comments on commit dbffc5e

Please sign in to comment.