diff --git a/.github/workflows/cpplint.yml b/.github/workflows/cpplint.yml new file mode 100644 index 0000000..cfdc0ce --- /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: + cpplint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + - run: pip install cpplint + - run: cpplint --recursive . 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) 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 . 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"] diff --git a/README.md b/README.md index 240e652..010d7f2 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 + 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 . + - 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,...] 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}"