diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..3bd710a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ +## Goal of this PR + + + + + +## How did I test it? + + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..a7e1497 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,20 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: "/" + schedule: + interval: weekly + groups: + all: + patterns: + - "*" + open-pull-requests-limit: 10 + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: weekly + groups: + all: + patterns: + - "*" + open-pull-requests-limit: 10 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7058ad4 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,108 @@ +name: Go Test + +on: + push: + branches: + - main + pull_request: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + go-version: [ "1.23" ] + env: + GOLANGCI_LINT_VERSION: v1.61.0 + + steps: + - name: Install Go + if: success() + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Run linter + uses: golangci/golangci-lint-action@v6 + with: + version: ${{ env.GOLANGCI_LINT_VERSION }} + + - name: Run tests + run: go run gotest.tools/gotestsum@latest --junitfile tests.xml --format pkgname -- -cover -race ./... + + - name: Test Summary + uses: test-summary/action@v2 + with: + paths: "tests.xml" + if: always() + + build: + runs-on: ubuntu-latest + strategy: + matrix: + os: + - darwin + - linux + - windows + arch: + - 386 + - amd64 + - arm + - arm64 + - ppc64le + - s390x + include: + - os: linux + arch: arm + arm: 7 + exclude: + - os: darwin + arch: 386 + - os: darwin + arch: arm + - os: darwin + arch: ppc64le + - os: darwin + arch: s390x + - os: windows + arch: arm + - os: windows + arch: arm64 + - os: windows + arch: ppc64le + - os: windows + arch: s390x + env: + GO_VERSION: "1.23" + + steps: + - name: Install Go + if: success() + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Checkout code + uses: actions/checkout@v4 + + - name: Cache Go modules + uses: actions/cache@v4 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Build oapi-gen + run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} GOARM=${{ matrix.arm }} go build ./cmd/oapi-gen diff --git a/.gitignore b/.gitignore index e69de29..b0747b2 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/oapi-gen diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 8197f93..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -include: - - component: "gitlab.com/nitrado/b2b/ci/components/utils/git@v1" - - component: "gitlab.com/nitrado/b2b/ci/components/go/lint-test@v0" - -default: - tags: - - b2b-cluster - -stages: - - lint - - test diff --git a/README.md b/README.md index 54a3999..2ec4908 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Any struct with the directive `openapi:gen` will have a documentation function g #### Install ```shell -$ go install gitlab.com/nitrado/b2b/go/openapi/cmd/oapi-gen@ +$ go install github.com/gamefabric/openapi/cmd/oapi-gen@ ``` A simple way to keep the generation up-to-date is to use Go's generation framework on each package that needs documentation functions. diff --git a/example_test.go b/example_test.go index 33066d7..85608a2 100644 --- a/example_test.go +++ b/example_test.go @@ -5,9 +5,9 @@ import ( "log" "net/http" + "github.com/gamefabric/openapi" kin "github.com/getkin/kin-openapi/openapi3" "github.com/go-chi/chi/v5" - "gitlab.com/nitrado/b2b/go/openapi" ) func Example() { diff --git a/gen_test.go b/gen_test.go index 0527bbd..1c67786 100644 --- a/gen_test.go +++ b/gen_test.go @@ -8,11 +8,11 @@ import ( "strconv" "testing" + "github.com/gamefabric/openapi" kin "github.com/getkin/kin-openapi/openapi3" "github.com/go-chi/chi/v5" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "gitlab.com/nitrado/b2b/go/openapi" ) var update = flag.Bool("update", false, "update the golden files of this test") diff --git a/go.mod b/go.mod index 77093f1..0b682a4 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gitlab.com/nitrado/b2b/go/openapi +module github.com/gamefabric/openapi go 1.23.0 diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 8be7046..0000000 --- a/renovate.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:base" - ], - "labels": ["renovatebot"], - "packageRules": [ - { - "matchDatasources": ["docker", "helm"], - "matchPackagePrefixes": [ - "registry.ffm.okd.marbis.net/" - ], - "enabled": false - } - ], - "postUpdateOptions": ["helmUpdateSubChartArchives"] - - -}