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

.github/ actions: replace travis #49

Merged
merged 1 commit into from
Jul 31, 2023
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 .checkpatch.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
--codespell
--codespellfile scripts/spelling.txt
--ignore C99_COMMENT_TOLERANCE
--no-tree
--strict
-g
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# Basic build test

name: build

# yamllint disable-line rule:truthy
on: [pull_request, push, workflow_dispatch]

env:
CMAKE_C_FLAGS: "-Werror -Wall -Wmissing-prototypes\
-Wimplicit-fallthrough=3 -Wpointer-arith"

jobs:
build-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with: {fetch-depth: 50, submodules: recursive}

- name: install tools
run: sudo apt update && sudo apt install -y ninja-build

- name: build
run: cmake -B build/ -G Ninja
- run: cmake --build build/
23 changes: 20 additions & 3 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,34 @@
# github.com also has a powerful web editor that can be used without
# committing.

name: checkpatch
name: codestyle

# yamllint disable-line rule:truthy
on: [pull_request]

jobs:
yamllint:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with: {fetch-depth: 50, submodules: recursive}
with:
fetch-depth: 50
submodules: recursive

- name: run yamllint
run: yamllint .github/workflows/*.yml
checkpatch:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you don't use $ref.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is passed into checkout

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the reason I did this is otherwise it was giving me a merge which doesn't work for checkpatch

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct: by default checkout gives pull/12355/merge which is what most people want by default (even when they don't have a clue).

BTW: https://github.com/thesofproject/sof/blob/main/.github/workflows/codestyle.yml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, ill look into that tomorrow, thanks for the pointer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a small repo, you should probably just do a fetch :0 (= infinite). In case someone submits 51 rimage patches ;-)

I wrote this code for the (huge) linux kernel initially but only ever tested on SOF (which does not really need it). Priorities...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest, this just makes me want to write my own github action for this so we can maintain in one spot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm someone did it, any issue if we just use this? https://github.com/marketplace/actions/checkpatch-pl-pr-review

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm someone did it, any issue if we just use this? https://github.com/marketplace/actions/checkpatch-pl-pr-review

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had a look at it. The code wouldn't pass shellcheck but it's short, understandable and uses the right API (i.e.: NOT git merge-base

Worth a try!

fetch-depth: ${{ env.PR_FETCH_DEPTH }}

- name: install codespell
cujomalainey marked this conversation as resolved.
Show resolved Hide resolved
run: sudo apt update && sudo apt install -y codespell

- name: checkpatch.pl PR review
uses: webispy/checkpatch-action@v9
env:
CHECKPATCH_COMMAND: ./scripts/checkpatch.pl
22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.