Kuadrant / authorino

K8s-native AuthN/AuthZ service to protect your APIs.
Apache License 2.0
201 stars 32 forks source link

CI/CD workflows #351

Open guicassolato opened 2 years ago

guicassolato commented 2 years ago

We want to improve automation in all repos for the Kuadrant components. We're aiming for:

  1. good coverage of automation tasks related to code style, testing, CD/CD (image builds, releases), etc
  2. consistency across components
  3. automation as manageable code – i.e. less mouse clicks across scaterred UI "settings" pages and more Gitops, more YAMLs hosted as part of a code base.

As part of a preliminary investigation (https://github.com/Kuadrant/kuadrant-operator/issues/21) of the current state of such automation, the following desired workflows and corresponding state for the Authorino repo were identified. Please review the list below.

Workflows do not have to be implemented exactly as in the list. The list is just a driver for the kind of tasks we want to cover. Each component should assess it as it makes sense, considering the component's specificities. More details in the original epic: https://github.com/Kuadrant/kuadrant-operator/issues/21.

You may also want to use this issue to reorganize how current workflows are implemented, thus helping us make the whole thing consistent across components.

guicassolato commented 2 years ago

An idea of how to organise this:

Name File (.github/workflows/) Trigger Scope (path filter)1 Steps
Code Style code-style.yaml
  • PR
  • **/*.go
  • *.mod
  • *.sum
  1. "Check out the code"
  2. "Set up Go environment"
  3. "Install dependencies" (goimports, reviewdog)
  4. "Linting" (golangci/golangci-lint-action@v2)
  5. "Code format" (gofmt)
  6. "Code format (imports)" (goimports)
  7. "Verify diff" (git diff)
Language language.yaml
  • PR
  • **
  1. "Check out the code"
  2. "Set up Go environment"
  3. "Install dependencies" (reviewdog, client9/misspell)
  4. "Check language" (reviewdog:woke)
  5. "Check spelling" (client9/misspell)
  6. "Check trailing white spaces" (reviewdog)
  7. "Check EOF" (reviewdog)
Unit Tests unit-testing.yaml
  • PR
  • Pushes to main and release/* branches
  • **/*.go
  • *.mod
  • *.sum
  • **/*.yaml
  • **/*.sh
  • Makefile
  • **/*.mk
  1. "Check out the code"
  2. "Set up Go environment"
  3. "Run the tests" (make test)
Unit Benchmarks unit-benchmarks.yaml
  • Pushes to main and release/* branches
  • Manual
  • **/*.go
  • *.mod
  • *.sum
  • **/*.yaml
  • **/*.sh
  • Makefile
  • **/*.mk
  1. "Check out the code"
  2. "Set up Go environment"
  3. "Run the tests" (make benchmarks)
End-to-end Tests e2e-tests.yaml
  • Pushes to main and release/* branches
  • Manual
  • !docs/**
  • !**/*.md
  • !**/*.adoc
  • !LICENCE
  • !PROJECT
  1. "Check out the code"
  2. "Set up Go environment"
  3. "Install dependencies" (jq)
  4. "Run the tests" (make e2e)
Smoke Tests smoke-tests.yaml
  • 'Build Images'
N/A
  1. "Install dependencies" (kind, jq)
  2. "Create Kubernetes cluster"
  3. "Setup the environment" (namespaces, apps, operators, CRDs, RBAC, etc)
  4. "Deploy the component" (image published to registry)
  5. "Run the tests" (e2e)
Performance Tests performance-tests.yaml
  • Manual
N/A
  1. "Install dependencies" (kind, jq)
  2. "Create Kubernetes cluster"
  3. "Setup the environment" (namespaces, apps, operators, CRDs, RBAC, etc)
  4. "Deploy the component"
  5. "Run the tests" (benchmarks)
Build Images build-images.yaml
  • Pushes to main and release/* branches
  • 'Release'
  • **
  1. "Check out the code"
  2. "Install dependencies" (qemu)
  3. Add tags ('latest', sanitized branch name)
  4. "Build the image" (redhat-actions/buildah-build@v2)
  5. "Push the image to registry" (redhat-actions/push-to-registry@v2)
Deploy deploy.yaml
  • 'Smoke Tests'
  • Manual
N/A
  1. "Amend the environment" (namespaces, apps, operators, CRDs, RBAC, etc)
  2. "(Re)deploy the component"
  3. "Run the tests" (e2e)
Release release.yaml
  • Manual
N/A
  1. "Tag and publish the release"

1 PRs and pushes only (ref).

TBD: Workflows related to Code scan (vulnerability and dependency updates) and Badges.