diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..2710e24 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "daily" + reviewers: + - "Fank" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + reviewers: + - "Fank" diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..c6ad9e3 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,93 @@ +name: Go + +on: + push: + branches: + - main + - master + pull_request: + +permissions: + contents: read + pull-requests: read + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: ./go.mod + + - name: Set up Golang build cache + uses: actions/cache@v4 + with: + path: ~/.cache/go-build + key: ${{ runner.os }}-golang-golangci-lint-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-golang- + + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: latest + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: ./go.mod + + - name: Set up Golang build cache + uses: actions/cache@v4 + with: + path: ~/.cache/go-build + key: ${{ runner.os }}-golang-test-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-golang- + + - name: Download go modules + run: go mod download + + - name: Test + uses: robherley/go-test-action@v0 + with: + testArguments: ./... + + license-check: + runs-on: ubuntu-latest + name: License Check + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version-file: ./go.mod + + - name: Install go-licenses + run: go install github.com/google/go-licenses@latest + shell: bash + + - name: Check licenses + run: > + go-licenses check ./... + --ignore ${{ github.repository }} + shell: bash + + - name: Get licenses list + run: > + go-licenses csv ./... + --ignore ${{ github.repository }} + shell: bash diff --git a/go.mod b/go.mod index 72841b8..8afc233 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,15 @@ -module gitlab.com/mclgmbh/golang-pkg/ingram +module github.com/enthus-golang/ingram -go 1.15 +go 1.22 require ( github.com/go-playground/validator/v10 v10.4.1 github.com/google/uuid v1.3.0 +) + +require ( + github.com/go-playground/locales v0.13.0 // indirect + github.com/go-playground/universal-translator v0.17.0 // indirect github.com/leodido/go-urn v1.2.1 // indirect golang.org/x/crypto v0.0.0-20201208171446-5f87f3452ae9 // indirect golang.org/x/sys v0.0.0-20201214095126-aec9a390925b // indirect diff --git a/go.sum b/go.sum index efc1fe0..ed2602b 100644 --- a/go.sum +++ b/go.sum @@ -33,7 +33,6 @@ golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXR golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=