From c246ec0edccf7d8eebafdd989a771dde7b3760bb Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 26 Nov 2019 23:27:14 +0100 Subject: [PATCH 1/8] GitHub Action to run cpplint on pushes & pull requests This is a much simpler solution that loads quickly but does not require a custom Dockerfile. --- .github/workflows/cpplint.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/cpplint.yml diff --git a/.github/workflows/cpplint.yml b/.github/workflows/cpplint.yml new file mode 100644 index 0000000..f6ee39c --- /dev/null +++ b/.github/workflows/cpplint.yml @@ -0,0 +1,13 @@ +# GitHub Action to run cpplint recursively on all pushes and pull requests +# https://github.com/cpplint/GitHub-Action-for-cpplint + +name: cpplint +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + - run: pip install cpplint + - run: cpplint --recursive . From ef653b4e2152b5f05858766f1d9d4571558d166d Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 26 Nov 2019 23:38:11 +0100 Subject: [PATCH 2/8] Update README.md --- README.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 240e652..bc66378 100644 --- a/README.md +++ b/README.md @@ -5,22 +5,18 @@ Each time that new code is pushed into your repo, you can have a [cpplint](https Example workflow: * Put the following text into a file named `.github/workflows/cpplint.yml` in your repo): ```yaml -on: push -name: on push +name: cpplint +on: [push, pull_request] jobs: - gitHubActionForCpplint: - name: GitHub Action for cpplint + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - name: GitHub Action for cpplint - uses: cpplint/GitHub-Action-for-cpplint@master - with: - args: cpplint --recursive . + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + - run: pip install cpplint + - run: cpplint --recursive . ``` - -Or to add other cpplint options to "__args =__" above. - +Customize the final line to match your requirements. ``` Syntax: cpplint.py [--verbose=#] [--output=emacs|eclipse|vs7|junit] [--filter=-x,+y,...] From ff5981141e058f80bd970f5d6215eb27031eca02 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 26 Nov 2019 23:41:17 +0100 Subject: [PATCH 3/8] Delete dockerimage.yml --- .github/workflows/dockerimage.yml | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 .github/workflows/dockerimage.yml diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml deleted file mode 100644 index 1514588..0000000 --- a/.github/workflows/dockerimage.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Docker Image CI - -on: [push] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) From 62c1382c01d2d312113c7fd03d9ce9772c1d13e1 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 26 Nov 2019 23:41:37 +0100 Subject: [PATCH 4/8] Delete main.yml --- .github/workflows/main.yml | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 1aa1dfa..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,12 +0,0 @@ -on: push -name: on push -jobs: - gitHubActionForCpplint: - name: GitHub Action for cpplint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: GitHub Action for cpplint - uses: cpplint/GitHub-Action-for-cpplint@master - with: - args: cpplint --recursive . From 265bb84da1867b2513149ba5f2c851fbf8c67224 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 26 Nov 2019 23:41:55 +0100 Subject: [PATCH 5/8] Delete Dockerfile --- Dockerfile | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 61cae9a..0000000 --- a/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:3.7-alpine - -LABEL "com.github.actions.name"="GitHub Action for cpplint" -LABEL "com.github.actions.description"="Run cpplint commands" -LABEL "com.github.actions.icon"="upload-cloud" -LABEL "com.github.actions.color"="green" - -RUN apk add --no-cache bash -RUN pip install --upgrade pip -RUN pip install cpplint -RUN python --version ; pip --version - -COPY entrypoint.sh / -RUN chmod +x /entrypoint.sh -ENTRYPOINT ["/entrypoint.sh"] From 875429ee5d6ab9c98651c62640b26c3b30d63b33 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 26 Nov 2019 23:42:15 +0100 Subject: [PATCH 6/8] Delete entrypoint.sh --- entrypoint.sh | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100644 index bfea110..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -e - -echo "##########################################" -echo "Starting ${GITHUB_WORKFLOW}:${GITHUB_ACTION}" - -sh -c "$*" - -echo "##########################################" -echo "Completed ${GITHUB_WORKFLOW}:${GITHUB_ACTION}" From 990417cdf269ab61fe57dcdffe888d2d8e43429d Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 26 Nov 2019 23:44:09 +0100 Subject: [PATCH 7/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc66378..010d7f2 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Example workflow: name: cpplint on: [push, pull_request] jobs: - build: + cpplint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 From 76978e59576567b0da0e7fff179993e2cc48fe7d Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 26 Nov 2019 23:44:51 +0100 Subject: [PATCH 8/8] Update cpplint.yml --- .github/workflows/cpplint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpplint.yml b/.github/workflows/cpplint.yml index f6ee39c..cfdc0ce 100644 --- a/.github/workflows/cpplint.yml +++ b/.github/workflows/cpplint.yml @@ -4,7 +4,7 @@ name: cpplint on: [push, pull_request] jobs: - build: + cpplint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1