From 4ddfd059b6a44b8ca2c2cc30b6c8abc5626a5e1f Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani Date: Wed, 9 Feb 2022 20:13:33 +0000 Subject: [PATCH] ci/cd: count lines of code Signed-off-by: Ramkumar Chinchani --- .github/workflows/cloc.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/cloc.yml diff --git a/.github/workflows/cloc.yml b/.github/workflows/cloc.yml new file mode 100644 index 00000000..e8b67ed2 --- /dev/null +++ b/.github/workflows/cloc.yml @@ -0,0 +1,34 @@ +name: "Lines of code statistics" +on: + push: + branches: + - main + pull_request: + branches: + - main + release: + types: + - published +jobs: + loc: + name: Lines of code + runs-on: ubuntu-latest + steps: + - name: Install go + uses: actions/setup-go@v2 + with: + go-version: 1.17.x + - name: Check out source code + uses: actions/checkout@v1 + - name: Install dependencies + run: | + cd $GITHUB_WORKSPACE + go install github.com/hhatto/gocloc/cmd/gocloc@latest + - name: All sources + run: | + cd $GITHUB_WORKSPACE + gocloc . + - name: All sources (except tests) + run: | + cd $GITHUB_WORKSPACE + gocloc --not-match='.*_test.go' .