Skip to content

Commit

Permalink
Merge pull request #10 from kilianpaquier/main
Browse files Browse the repository at this point in the history
Backmerge
  • Loading branch information
kilianpaquier authored Mar 10, 2024
2 parents 7191d66 + 707f11c commit c832a2b
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 51 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: go.mod
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/go-dependency-submission@v2
with:
go-mod-path: go.mod
34 changes: 23 additions & 11 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,59 @@ on:
- staging
- develop
- v[0-9]+
- v[0-9]+.[0-9]+
workflow_dispatch:

jobs:

go-vulncheck:
runs-on: ubuntu-latest
steps:
- uses: golang/govulncheck-action@v1
with:
check-latest: true
go-package: ./...
go-version-file: go.mod

go-lint:
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
cache: false
check-latest: true
go-version-file: go.mod
token: ${{ secrets.GITHUB_TOKEN }}
- uses: golangci/golangci-lint-action@v4
with:
args: --config .golangci.yml --timeout 240s --fast --sort-results --out-format colored-line-number
args: --config build/ci/.golangci.yml --timeout 240s --fast --sort-results --out-format colored-line-number

go-test:
strategy:
fail-fast: false
matrix:
os:
- on: macos-latest
include:
- os: macos-latest
args: CGO_ENABLED="0"
- on: ubuntu-latest
- os: ubuntu-latest
args: CGO_ENABLED="0"
- on: windows-latest
- os: windows-latest
args: env CGO_ENABLED="0"
runs-on: ${{ matrix.os.on }}
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os.on }}
OS: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: go.mod
token: ${{ secrets.GITHUB_TOKEN }}
- run: ${{ matrix.os.args }} go test ./... -coverpkg="./..." -covermode="count" -coverprofile="coverage.out"
- run: ${{ matrix.args }} go test ./... -coverpkg="./..." -covermode="count" -coverprofile="coverage.out"
- uses: codecov/codecov-action@v4
if: ${{ ! startsWith(github.ref_name, 'dependabot') }} # ignore codecov on dependabot branches
if: ${{ ! startsWith(github.base_ref, 'dependabot') }} # ignore codecov on dependabot branches
with:
codecov_yml_path: codecov.yml
disable_search: true
Expand All @@ -67,7 +79,7 @@ jobs:
pull-requests: write
security-events: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: hadolint/[email protected]
continue-on-error: true # enforce scan upload to codeql
with:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
outputs:
version: v${{ steps.semantic_release.outputs.new_release_version }}
release: ${{ steps.release.outputs.release }}
Expand All @@ -42,7 +44,7 @@ jobs:
branches: |
[
"(master|main)",
"v+([0-9])?(.{+([0-9]),x}).x",
"v+([0-9])",
{ "name": "next", "prerelease": true },
{ "name": "beta", "prerelease": true },
{ "name": "alpha", "prerelease": true },
Expand All @@ -67,11 +69,12 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: go.mod
token: ${{ secrets.GITHUB_TOKEN }}
- uses: goreleaser/goreleaser-action@v5
with:
args: release --clean --config .goreleaser.yml --skip=validate --skip=announce --skip=publish --snapshot
args: release --clean --config build/ci/.goreleaser.yml --skip=validate --skip=announce --skip=publish --snapshot
env:
VERSION: ${{ needs.version.outputs.version }}
- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -150,6 +153,7 @@ jobs:
permissions:
contents: write
issues: write
pull-requests: write
needs:
- go-build
- docker-build
Expand All @@ -165,6 +169,7 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: executables
path: dist
- id: semantic-release
uses: cycjimmy/semantic-release-action@v4
with:
Expand All @@ -182,7 +187,7 @@ jobs:
branches: |
[
"(master|main)",
"v+([0-9])?(.{+([0-9]),x}).x",
"v+([0-9])",
{ "name": "next", "prerelease": true },
{ "name": "beta", "prerelease": true },
{ "name": "alpha", "prerelease": true },
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dist
go.work

# reports
reports/
*.json
*.xml

Expand Down
5 changes: 3 additions & 2 deletions .releaserc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ plugins:
- assets:
- { path: CHANGELOG.md, label: CHANGELOG.md }
- { path: checksums.txt }
- { path: dist/* }
failComment: false,
- { path: dist }
failComment: true
failTitle: false
successComment: 🎉 This issue has been resolved in version v${nextRelease.version} 🎉
- "@semantic-release/exec"
11 changes: 1 addition & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
# This file is safe to edit. Once it exists it will not be overwritten.

include ./scripts/*.mk

.PHONY: generate
generate:
@craft generate $(ARGS)

.PHONY: clean
clean:
@go clean
@git clean -Xf ./*
include ./scripts/*.mk
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,38 @@ require (
github.com/ezian/pipe v0.1.0
github.com/go-playground/validator/v10 v10.19.0
github.com/jarcoal/httpmock v1.3.1
github.com/kilianpaquier/pooling v0.0.0-20240302190619-1cb3bc8efe6a
github.com/kilianpaquier/pooling v0.0.0-20240304064300-a0801914b1e0
github.com/kilianpaquier/testlogrus v0.0.0-20240302124840-f94674d38ad3
github.com/panjf2000/ants/v2 v2.9.0
github.com/samber/lo v1.39.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.9.0
github.com/xanzy/go-gitlab v0.98.0
github.com/xanzy/go-gitlab v0.99.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.5 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
golang.org/x/crypto v0.20.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
32 changes: 16 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ github.com/go-playground/validator/v10 v10.19.0 h1:ol+5Fu+cSq9JD7SoSqe04GMI92cbn
github.com/go-playground/validator/v10 v10.19.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
Expand All @@ -34,8 +34,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/jarcoal/httpmock v1.3.1 h1:iUx3whfZWVf3jT01hQTO/Eo5sAYtB2/rqaUuOtpInww=
github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPaZjnENuYg=
github.com/kilianpaquier/pooling v0.0.0-20240302190619-1cb3bc8efe6a h1:KwllKtJhu67tlA4hueeTTJpw0AqrXrIzIkAVE2F8AmY=
github.com/kilianpaquier/pooling v0.0.0-20240302190619-1cb3bc8efe6a/go.mod h1:AGdSCDx+BRfJev1ADeKuhTd9a4J5x1SWg98kiBaXxdc=
github.com/kilianpaquier/pooling v0.0.0-20240304064300-a0801914b1e0 h1:MYILhHAEzaRFgp91biJbTzKqTkDG++PBsicJnPA5II0=
github.com/kilianpaquier/pooling v0.0.0-20240304064300-a0801914b1e0/go.mod h1:AGdSCDx+BRfJev1ADeKuhTd9a4J5x1SWg98kiBaXxdc=
github.com/kilianpaquier/testlogrus v0.0.0-20240302124840-f94674d38ad3 h1:W/iIT5Oqow9scSzw1QkGoaeVIpIh57qv4d9HFVNTd48=
github.com/kilianpaquier/testlogrus v0.0.0-20240302124840-f94674d38ad3/go.mod h1:6YYmCgnrlMRYaAYJSBV0eC2oKeKyc9xyFtxVfgPTerY=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
Expand Down Expand Up @@ -65,23 +65,23 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/xanzy/go-gitlab v0.98.0 h1:psTMbnA0vSo512M8WUpM5YIFPxrdQ/11V0y/5SdzIIg=
github.com/xanzy/go-gitlab v0.98.0/go.mod h1:ETg8tcj4OhrB84UEgeE8dSuV/0h4BBL1uOV/qK0vlyI=
github.com/xanzy/go-gitlab v0.99.0 h1:0W5dmFQejPlqnScZoGRXNPmx+evOxBMk50P40cxlnWU=
github.com/xanzy/go-gitlab v0.99.0/go.mod h1:ETg8tcj4OhrB84UEgeE8dSuV/0h4BBL1uOV/qK0vlyI=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg=
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ=
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ=
golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA=
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI=
golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
Expand All @@ -93,8 +93,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -114,8 +114,8 @@ google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAs
google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
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.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
2 changes: 1 addition & 1 deletion scripts/build.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Code generated by craft; DO NOT EDIT.

CI_PROJECT_PATH := github.com/kilianpaquier/gitlab-storage-cleaner
GCI_CONFIG_PATH := .golangci.yml
GCI_CONFIG_PATH := build/ci/.golangci.yml

.PHONY: lint
lint:
Expand Down
10 changes: 10 additions & 0 deletions scripts/craft.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Code generated by craft; DO NOT EDIT.

.PHONY: generate
generate:
@craft generate $(ARGS)

.PHONY: clean
clean:
@go clean
@git clean -Xf ./*

0 comments on commit c832a2b

Please sign in to comment.