diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..180599d --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,76 @@ +name: CI + +on: + pull_request: + push: + # branches: + # - 'main' + +env: + cache-version: 1 + IMAGE: ghcr.io/giganticminecraft/seichi-gateway-operator + +jobs: + + lint: + name: Small tests + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 + with: + go-version-file: go.mod + cache: true + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + # Require: The version of golangci-lint to use. + # When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version. + # When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit. + version: v1.54 + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + + # - name: Login to GitHub Container Registry + # uses: docker/login-action@v3 + # with: + # registry: ghcr.io + # username: ${{ github.repository_owner }} + # password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.IMAGE }} + tags: | + type=sha,prefix=sha-,suffix=,format=short + type=schedule,pattern={{date 'YYYYMMDD'}} + + - name: Build (never push) + id: docker_build + uses: docker/build-push-action@v5 + with: + context: . + builder: ${{ steps.buildx.outputs.name }} + push: false + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + # すべてのビルドステージのすべてのレイヤーをキャッシュして欲しいのでmode=max + cache-to: type=gha,mode=max + + # - name: Build (and push if on main) + # id: docker_build + # uses: docker/build-push-action@v5 + # with: + # context: . + # builder: ${{ steps.buildx.outputs.name }} + # push: ${{ github.ref == 'refs/heads/main' }} + # tags: ${{ steps.meta.outputs.tags }} + # labels: ${{ steps.meta.outputs.labels }} + # cache-from: type=gha + # # すべてのビルドステージのすべてのレイヤーをキャッシュして欲しいのでmode=max + # cache-to: type=gha,mode=max diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index fd8c0ab..d6cd523 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -30,7 +30,6 @@ func (in *BungeeConfigTemplate) DeepCopyInto(out *BungeeConfigTemplate) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) out.Spec = in.Spec - out.Status = in.Status } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BungeeConfigTemplate. @@ -98,21 +97,6 @@ func (in *BungeeConfigTemplateSpec) DeepCopy() *BungeeConfigTemplateSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BungeeConfigTemplateStatus) DeepCopyInto(out *BungeeConfigTemplateStatus) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BungeeConfigTemplateStatus. -func (in *BungeeConfigTemplateStatus) DeepCopy() *BungeeConfigTemplateStatus { - if in == nil { - return nil - } - out := new(BungeeConfigTemplateStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SeichiReviewGateway) DeepCopyInto(out *SeichiReviewGateway) { *out = *in diff --git a/go.mod b/go.mod index 97235a2..445757b 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.20 require ( github.com/onsi/ginkgo/v2 v2.11.0 github.com/onsi/gomega v1.27.10 + k8s.io/api v0.28.0 k8s.io/apimachinery v0.28.0 k8s.io/client-go v0.28.0 sigs.k8s.io/controller-runtime v0.16.0 @@ -61,7 +62,6 @@ require ( gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/api v0.28.0 // indirect k8s.io/apiextensions-apiserver v0.28.0 // indirect k8s.io/component-base v0.28.0 // indirect k8s.io/klog/v2 v2.100.1 // indirect