Skip to content

Commit

Permalink
Add CI things
Browse files Browse the repository at this point in the history
Signed-off-by: Dinar Valeev <k0da@opensuse.org>
  • Loading branch information
k0da committed Sep 11, 2024
1 parent 40ebf8a commit 81135fe
Show file tree
Hide file tree
Showing 17 changed files with 817 additions and 3 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/golagci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2024 The external-dns-infoblox-webhook Contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
---
name: GolangCI
on: # yamllint disable-line rule:truthy
push:
paths-ignore:
- '**.md'
pull_request:
branches:
- main
jobs:
lint:
name: GolangCI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: GolangCI
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
args: --timeout=3m
36 changes: 36 additions & 0 deletions .github/workflows/golic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2024 The external-dns-infoblox-webhook Contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
---
name: GoLic
on: # yamllint disable-line rule:truthy
push:
paths-ignore:
- '**.md'
pull_request:
branches:
- main
jobs:
golic:
name: GoLic
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: golic
run: |
export PATH=${PATH}:`go env GOPATH`/bin
go install github.com/AbsaOSS/golic@v0.7.2
golic inject --dry -x -t apache2
93 changes: 93 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Copyright 2024 The external-dns-infoblox-webhook Contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
---
name: Release

on: # yamllint disable-line rule:truthy
push:
branches:
- main

permissions:
contents: write
pull-requests: write
packages: write
id-token: write

env:
GO111MODULE: "on"

jobs:
release:
runs-on: ubuntu-latest
name: Release
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}

steps:
- uses: googleapis/release-please-action@v4
id: release

provider:
if: needs.release.outputs.release_created
runs-on: ubuntu-latest
name: Publish Provider
needs:
- release
strategy:
max-parallel: 4
matrix:
go-version: [1.22.x]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "${{ matrix.go-version }}"

- name: Install cosign
uses: sigstore/cosign-installer@v3.5.0
- name: Download Syft
uses: anchore/sbom-action/download-syft@v0.16.0

- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Release via GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
args: -p 3 release --clean --timeout 60m0s
version: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI_COMMIT_TIMESTAMP: ${{ github.event.repository.updated_at }}
CI_COMMIT_SHA: ${{ github.sha }}
CI_COMMIT_TAG: ${{ needs.release.outputs.tag_name }}
38 changes: 38 additions & 0 deletions .github/workflows/yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2024 The external-dns-infoblox-webhook Contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
---
name: YamlLint
on: # yamllint disable-line rule:truthy
push:
paths-ignore:
- '**.md'
pull_request:
branches:
- main
jobs:
lint:
name: YamlLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5

- name: YamlLint
run: yamllint .
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Ignore everything
*

# But not these files...
!/.gitignore

!*.go
!go.sum
!go.mod

!Makefile
!*.yaml

!.release-please-manifest.json
!release-please-config.json
!.goreleaser.yml
!.gitleaks.toml
!.yamllint
!.golangci.toml
!.golic.yaml
!.licignore
!Dockerfile
!CODEOWNERS
!README.md
!LICENSE
!renovate.json

# ...even if they are in subdirectories
!*/
9 changes: 9 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title = "Gitleaks Configuration"

[extend]
useDefault = true
[allowlist]
description = "global allow list"
paths = [
'''README.md''','''.idea''','''.vscode'''
]
52 changes: 52 additions & 0 deletions .golic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2024 The external-dns-infoblox-webhook Contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
# Copyright 2022 The k8gb Contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
golic:

Check warning on line 31 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

31:1 [document-start] missing document start "---"

Check warning on line 31 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

31:1 [document-start] missing document start "---"
licenses:
apache2: |
Copyright 2024 The external-dns-infoblox-webhook Contributors.

Check failure on line 35 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

35:1 [trailing-spaces] trailing spaces

Check failure on line 35 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

35:1 [trailing-spaces] trailing spaces
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Check failure on line 39 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

39:1 [trailing-spaces] trailing spaces

Check failure on line 39 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

39:1 [trailing-spaces] trailing spaces
http://www.apache.org/licenses/LICENSE-2.0

Check failure on line 41 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

41:1 [trailing-spaces] trailing spaces

Check failure on line 41 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

41:1 [trailing-spaces] trailing spaces
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Check failure on line 47 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

47:1 [trailing-spaces] trailing spaces

Check failure on line 47 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

47:1 [trailing-spaces] trailing spaces
Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic
rules:
"*.go.txt":
prefix: "/*"
suffix: "*/"

Check failure on line 52 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

52:19 [new-line-at-end-of-file] no new line character at the end of file

Check failure on line 52 in .golic.yaml

View workflow job for this annotation

GitHub Actions / YamlLint

52:19 [new-line-at-end-of-file] no new line character at the end of file
Loading

0 comments on commit 81135fe

Please sign in to comment.