diff --git a/.checkpatch.conf b/.checkpatch.conf new file mode 100644 index 0000000..98ddafc --- /dev/null +++ b/.checkpatch.conf @@ -0,0 +1,6 @@ +--codespell +--codespellfile scripts/spelling.txt +--ignore C99_COMMENT_TOLERANCE +--no-tree +--strict +-g diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2102fae --- /dev/null +++ b/.github/workflows/build.yml @@ -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/ diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index b821ce4..c040049 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -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 }} + fetch-depth: ${{ env.PR_FETCH_DEPTH }} + + - name: install codespell + 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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d895210..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: c - -git: - depth: false - -services: - - docker - -jobs: - include: - - name: "Build Test" - before_install: docker pull thesofproject/sof && docker tag thesofproject/sof sof - script: - - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Werror -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh - - docker run -i -t -v $(pwd):/home/sof/work/sof.git --user $(id -u) sof ./build.sh - - name: checkpatch - before_install: - - sudo apt-get -y install codespell - script: - - git --no-pager log --oneline --graph --decorate --max-count=5 - - git --no-pager log --oneline --graph --decorate --max-count=5 "${TRAVIS_BRANCH}" - - (set -x; scripts/checkpatch.pl --no-tree --strict --codespell --no-signoff -g ${TRAVIS_COMMIT_RANGE/.../..})