Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into enable-another-batc…
Browse files Browse the repository at this point in the history
…h-of-linters
  • Loading branch information
k15r committed Dec 14, 2023
2 parents df6ebd1 + e7a0190 commit 00309fd
Show file tree
Hide file tree
Showing 45 changed files with 739 additions and 265 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ on:
workflow_dispatch:
inputs:
name:
description: 'Release name'
description: 'Release name ( e.g. "2.1.3" )'
default: ""
required: true

jobs:
verify-head-status:
name: Verify head
name: Verify head (image version and prow job)
runs-on: ubuntu-latest

steps:
Expand All @@ -19,18 +19,22 @@ jobs:
with:
fetch-depth: 0

- name: Check tag
run: ./scripts/check_release_tag.sh ${{ github.event.inputs.name }}

- name: Check image
run: ./scripts/check_image.sh ${{ github.ref_name }}

- name: Verify
run: ./scripts/verify-status.sh ${{ github.ref_name }}

# run-unit-tests:
# name: Unit tests
# needs: verify-head-status
- name: Verify that the current branch has a name that starts with 'release-'
run: |
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [[ "$CURRENT_BRANCH" == release-* ]]; then
echo "Branch name starts with 'release-'."
else
echo "Branch name does not start with 'release-'."
exit 1
fi
- name: Check image Tag
run: ./scripts/check_tag_info.sh ${{ github.event.inputs.name }}

# run-unit-tests:
# name: Unit tests
# needs: verify-head-status
# uses: "./.github/workflows/run-unit-tests.yaml"

create-draft:
Expand Down Expand Up @@ -62,6 +66,9 @@ jobs:
git tag ${{ github.event.inputs.name }}
git push origin ${{ github.event.inputs.name }}
- name: Verify job status
run: ./scripts/verify-status.sh ${{ github.ref_name }} 600 10 30

outputs:
release_id: ${{ steps.create-draft.outputs.release_id }}

Expand All @@ -84,4 +91,4 @@ jobs:
- name: Publish release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/publish_release.sh ${{ needs.create-draft.outputs.release_id }}
run: ./scripts/publish_release.sh ${{ needs.create-draft.outputs.release_id }}
12 changes: 7 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ env:

on:
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

jobs:
nats:
Expand Down Expand Up @@ -59,7 +61,7 @@ jobs:
- name: Setup and test the eventing-manager
run: |
make e2e-setup
make e2e-setup
- name: Setup eventing
run: |
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ name: golangci-lint

on:
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

permissions:
contents: read
Expand All @@ -17,9 +19,9 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: "1.21"
cache: false
- uses: actions/checkout@v4
- name: golangci-lint
Expand Down
100 changes: 51 additions & 49 deletions .github/workflows/sink.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ env:
on:
push:
branches:
- main
tags: [ '*.*.*' ]
- main
- "release-*"
tags: ["*.*.*"]
paths:
- 'hack/e2e/sink/**'
- '.github/workflows/sink.yml'
- "hack/e2e/sink/**"
- ".github/workflows/sink.yml"
pull_request:
branches:
- main
- main
- "release-*"
paths:
- 'hack/e2e/sink/**'
- '.github/workflows/sink.yml'
- "hack/e2e/sink/**"
- ".github/workflows/sink.yml"

jobs:
build:
Expand All @@ -32,51 +34,51 @@ jobs:
working-directory: ${{ env.E2E_SINK_DIR }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
cache: true
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19
cache: true

- name: Build
run: go build -v ./...
- name: Build
run: go build -v ./...

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
# if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
# if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=semver,pattern={{version}},event=tag
labels: |
org.opencontainers.image.title=E2E Tests Sink
org.opencontainers.image.description=A webserver imitating an eventing sink that receives events and stores in memory
org.opencontainers.image.url=https://github.com/kyma-project/eventing-manager/${{ env.E2E_SINK_DIR }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=semver,pattern={{version}},event=tag
labels: |
org.opencontainers.image.title=E2E Tests Sink
org.opencontainers.image.description=A webserver imitating an eventing sink that receives events and stores in memory
org.opencontainers.image.url=https://github.com/kyma-project/eventing-manager/${{ env.E2E_SINK_DIR }}
- name: Build Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: ${{ env.E2E_SINK_DIR }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: ${{ github.event_name == 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: ${{ env.E2E_SINK_DIR }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: ${{ github.event_name == 'pull_request' }}
cache-from: type=gha
cache-to: type=gha,mode=max
24 changes: 14 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,31 @@ env:

on:
push:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- 'sec-scanners-config.yaml'
- "docs/**"
- "**.md"
- "sec-scanners-config.yaml"

jobs:
unit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: "1.21"
cache: false
- name: Sync GO dependencies
run: |
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ env:

on:
push:
branches: [ "main" ]
branches:
- main
- "release-*"
paths:
- 'api/**'
- 'config/crd/**'
- "api/**"
- "config/crd/**"
pull_request:
branches: [ "main" ]
branches:
- main
- "release-*"
paths:
- 'api/**'
- 'config/crd/**'
- "api/**"
- "config/crd/**"

jobs:
crd:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ module-template.yaml
eventing-manager.yaml
module-config.yaml

.env.dev
**/.env
**/.env.dev
2 changes: 2 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ linters-settings:
alias: kctrl
- pkg: sigs.k8s.io/controller-runtime/pkg/log
alias: kctrllog
- pkg: sigs.k8s.io/controller-runtime/pkg/client
alias: kctrlclient
- pkg: k8s.io/api/autoscaling/v1
alias: kautoscalingv1
- pkg: k8s.io/api/autoscaling/v2
Expand Down
8 changes: 8 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@
* @kyma-project/eventing

*.md @kyma-project/technical-writers

*.sh @kyma-project/eventing @the1bit

/.github/ @kyma-project/eventing @the1bit

/.version @kyma-project/eventing @the1bit

/.sec-scanners-config.yaml @kyma-project/eventing @the1bit
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -331,3 +331,8 @@ $(TABLE_GEN): $(LOCALBIN)
.PHONY: crd-docs-gen
crd-docs-gen: tablegen ## Generates CRD spec into docs folder
${TABLE_GEN} --crd-filename ./config/crd/bases/operator.kyma-project.io_eventings.yaml --md-filename ./docs/user/02-configuration.md

# clean-testcache cleans the go test cache.
.PHONY: clean-testcache
clean-testcache:
go clean -testcache
Loading

0 comments on commit 00309fd

Please sign in to comment.