From a33b1bb519660c67f0388c8baf51ea6490d22f60 Mon Sep 17 00:00:00 2001 From: Alessio Perugini Date: Mon, 15 May 2023 12:48:24 +0200 Subject: [PATCH] add go license header check in CI --- .github/workflows/check-go-task.yml | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/check-go-task.yml b/.github/workflows/check-go-task.yml index f68a4c62b76..f2aef88cdb5 100644 --- a/.github/workflows/check-go-task.yml +++ b/.github/workflows/check-go-task.yml @@ -219,6 +219,42 @@ jobs: - name: Check whether any tidying was needed run: git diff --color --exit-code + check-license-headers: + name: check-license-headers (${{ matrix.module.path }}) + needs: run-determination + if: needs.run-determination.outputs.result == 'true' + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + module: + - path: ./ + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Task + uses: arduino/setup-task@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: 3.x + + - name: Check license headers + env: + GO_MODULE_PATH: ${{ matrix.module.path }} + run: task go:check-license-headers + + - name: Check formatting + run: git diff --color --exit-code + # Do a simple "smoke test" build for the modules with no other form of validation build: name: build (${{ matrix.module.path }})