Skip to content

Commit

Permalink
Import private repo in a squashed manner
Browse files Browse the repository at this point in the history
Co-authored-by: Miguel Bernabeu <[email protected]>
Co-authored-by: Alfredo Lopez <[email protected]>
Co-authored-by: Ricardo Garmendia <[email protected]>
Co-authored-by: Oscar Ferrer <[email protected]>
Co-authored-by: João Alves <[email protected]>
Co-authored-by: Tanat Lokejaroenlarb <[email protected]>
Co-authored-by: Fabian Selles <[email protected]>

Change-Id: I7700bc258eb26a7b9ea60894b855ee0598891fd0
  • Loading branch information
tjamet authored and Thibault Jamet committed Jan 23, 2025
1 parent 09db648 commit 09b53ec
Show file tree
Hide file tree
Showing 70 changed files with 30,098 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: 2
registries:
github:
type: git
url: https://github.com
username: ${{secrets.EXTERNAL_GITHUB_USER}}
password: ${{secrets.EXTERNAL_GITHUB_TOKEN}}

updates:
- package-ecosystem: "gomod"
directory: "/"
registries:
- github
schedule:
interval: "daily"
commit-message:
prefix: chore
include: scope
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: chore
include: scope

45 changes: 45 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: build
on: [push, pull_request, merge_group]

jobs:
build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: Set up Docker context for Buildx
id: buildx-context
run: |
docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
endpoint: builders

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

- uses: actions/checkout@v4

- name: Build images
id: buildimages
run: |
img=ghcr.io/${{github.repository}}:${{github.sha}}
echo "IMAGE_NAME=${img} >> $GITHUB_OUTPUT"
docker pull ${img} || (
docker buildx build --push --cache-to type=gha,mode=max --cache-from type=gha --progress plain --platform linux/arm64/v8,linux/amd64 --build-arg BUILDKIT_INLINE_CACHE=1 -t ${img} .
)
- name: Build main image images
id: buildmainimage
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
run: |
img=ghcr.io/${{github.repository}}:latest
echo "IMAGE_NAME=${img} >> $GITHUB_OUTPUT"
docker buildx build --push --cache-to type=gha,mode=max --cache-from type=gha --progress plain --platform linux/arm64/v8,linux/amd64 --build-arg BUILDKIT_INLINE_CACHE=1 -t ${img} .
27 changes: 27 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: golangci-lint
on:
push:
branches:
- main
- master
pull_request:
merge_group:

permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.4'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60.3
21 changes: 21 additions & 0 deletions .github/workflows/manage-stale-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Manage stale branches'
on:
schedule:
# Run every monday at 10 am
- cron: "0 10 * * 1"

jobs:
manage-stale-branches:
name: "Manage stale branches"
runs-on: ubuntu-latest
steps:
- name: "Manage Stale Branches"
id: manage-stale-branches
uses: crazy-matt/[email protected]
with:
gh_token: ${{ secrets.GITHUB_TOKEN }}
stale_older_than: 60
suggestions_older_than: 30
excluded_branches: |
origin/main
origin/master
66 changes: 66 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: run tests

on:
push:
pull_request:
merge_group:

jobs:
testGo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.22.4
- name: Run CI script
run: |
go test -v -cover -covermode=count ./...
# testGCloudIntegration:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-go@v5
# with:
# go-version: 1.22.4
# - name: Run CI script
# run: |
# go test -v ./pkg/grafanacloud/...
# env:
# GRAFANA_CLOUD_TOKEN: ${{ secrets.GRAFANA_CLOUD_TOKEN }}

alloy_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.4'
- run: |
cd pkg/controllers
curl -LO https://github.com/grafana/alloy/releases/download/v1.3.1/alloy-linux-amd64.zip && unzip alloy-linux-amd64.zip
go test -v ./... -args -verify-alloy
testHelm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
depth: 0

- uses: azure/[email protected]
with:
version: v3.12.0

- name: Set up chart-testing
uses: helm/[email protected]

- run: |
git fetch origin "${{ github.base_ref }}"
# Ensure the chart meets requirements
ct lint --remote origin --target-branch "${{ github.base_ref }}" --charts ./helm-chart/observability-operator
# Ensure the chart can be rendered with default values set and the generated yaml is coherent
helm template ./helm-chart/observability-operator
# Ensure the chart can be rendered with all values set and the generated yaml is coherent
helm template ./helm-chart/observability-operator -f ./helm-chart/observability-operator/values-test-full.yaml
28 changes: 28 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Kubernetes Generated files - skip generated files, except for vendored files

!vendor/**/zz_generated.*

# editor and IDE paraphernalia
.idea
*.swp
*.swo
*~
.helm
vendor
profile.cov
junit.xml
.vscode
58 changes: 58 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Options for analysis running.
run:
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 10m
# Exit code when at least one issue was found.
# Default: 1
issues-exit-code: 2
# If set, we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
#
# Allowed values: readonly|vendor|mod
# Default: ""
modules-download-mode: readonly

# output configuration options
output:
# The formats used to render issues.
# Formats:
# - `colored-line-number`
# - `line-number`
# - `json`
# - `colored-tab`
# - `tab`
# - `html`
# - `checkstyle`
# - `code-climate`
# - `junit-xml`
# - `github-actions`
# - `teamcity`
# - `sarif`
# Output path can be either `stdout`, `stderr` or path to the file to write to.
#
# For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma.
# The output can be specified for each of them by separating format name and path by colon symbol.
# Example: "--out-format=checkstyle:report.xml,json:stdout,colored-line-number"
# The CLI flag (`--out-format`) override the configuration file.
#
# Default:
# formats:
# - format: colored-line-number
# path: stdout
formats:
- format: colored-line-number
path: stdout
# Show statistics per linter.
# Default: false
show-stats: true
issues:
# Show only new issues created after git revision `REV`.
# Default: ""
new-from-rev: master
7 changes: 7 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: default

rules:
line-length: disable
document-start: disable
indentation:
indent-sequences: consistent
Loading

0 comments on commit 09b53ec

Please sign in to comment.