Skip to content

Commit

Permalink
add linting to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Maed223 committed Oct 30, 2024
1 parent 1ccd97c commit 873ee78
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/actions/lint-terraform-svchost/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: Lint
description: Lints terraform-svchost
runs:
using: composite
steps:
- name: Setup Go Environment
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: "go.mod"
cache: true

- name: fmt check
run: make fmtcheck
shell: bash

- name: go vet
run: make vet
shell: bash

- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/0b5709648c8ba9780e821faf16c5c2bb3262ce3e/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCILINT_VERSION
shell: bash
env:
GOLANGCILINT_VERSION: v1.55.2

- run: make lint
shell: bash
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ on:
- main

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6

- uses: ./.github/actions/lint-terraform-svchost
copywrite:
name: Run Header Copyright
runs-on: ubuntu-latest
Expand Down

0 comments on commit 873ee78

Please sign in to comment.