Skip to content

Commit

Permalink
chore: Simplify Makefile Architecture (#832)
Browse files Browse the repository at this point in the history
Co-authored-by: Nina Hingerl <[email protected]>
  • Loading branch information
TeodorSAP and NHingerl authored Mar 7, 2024
1 parent c7d1951 commit 3402365
Show file tree
Hide file tree
Showing 19 changed files with 459 additions and 427 deletions.
18 changes: 18 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### Default Environment Variables
## General
ENV_ENVTEST_K8S_VERSION=1.27.1 # ENVTEST_K8S_VERSION refers to the version of Kubebuilder assets to be downloaded by envtest binary.
ENV_IMG=europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:main # Image URL to use all building/pushing image targets

## Gardener
ENV_GARDENER_K8S_VERSION=1.27
ENV_GARDENER_OS_VERSION="Not Defined"

## Dependencies
ENV_CONTROLLER_TOOLS_VERSION=v0.11.3
ENV_GINKGO_VERSION=v2.15.0
ENV_GO_TEST_COVERAGE_VERSION=v2.8.2
ENV_GOLANGCI-LINT_VERSION=latest
ENV_ISTIO_VERSION=1.3.2
ENV_K3D_VERSION=v5.4.7
ENV_KUSTOMIZE_VERSION=v5.0.1
ENV_TABLE_GEN_VERSION=v0.0.0-20230523174756-3dae9f177ffd
7 changes: 5 additions & 2 deletions .github/template/prepare-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ runs:
using: "composite"

steps:

- name: Setup Golang
uses: "./.github/template/setup-golang"

- name: Setup Ginkgo
shell: bash
run: make ginkgo

- name: Provision K3D
shell: bash
run: make provision-k3d
Expand Down Expand Up @@ -51,6 +54,6 @@ runs:

- name: Print cluster info
shell: bash
run: |
run: |
kubectl cluster-info
kubectl -n kyma-system get po
2 changes: 1 addition & 1 deletion .github/workflows/branch-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

# provision cluster and run tests
- name: Run test
run: make gardener-integration-test
run: hack/gardener-integration-test.sh
env:
GARDENER_SECRET_NAME: ${{ secrets.GARDENER_SECRET_NAME }}
GARDENER_PROJECT: ${{ secrets.GARDENER_PROJECT }}
Expand Down
178 changes: 90 additions & 88 deletions .github/workflows/pr-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
- "main"
- "release-*"
paths-ignore:
- 'docs/**'
- '**.md'
- "docs/**"
- "**.md"
workflow_dispatch:

jobs:
Expand All @@ -27,7 +27,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: make run-e2e-test-metrics
run: bin/ginkgo run --tags e2e --label-filter="metrics" test/e2e

- name: Finalize test
uses: "./.github/template/finalize-test"
Expand All @@ -38,104 +38,104 @@ jobs:
e2e-metrics:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Checkout repo
uses: actions/checkout@v4

- name: Prepare test
uses: "./.github/template/prepare-test"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare test
uses: "./.github/template/prepare-test"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: make run-e2e-test-metrics
- name: Run tests
run: bin/ginkgo run --tags e2e --label-filter="metrics" test/e2e

- name: Finalize test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
- name: Finalize test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()

e2e-traces-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Checkout repo
uses: actions/checkout@v4

- name: Prepare Test
uses: "./.github/template/prepare-test"
with:
release: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Test
uses: "./.github/template/prepare-test"
with:
release: true
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: make run-e2e-test-traces
- name: Run tests
run: bin/ginkgo run --tags e2e --label-filter="traces" test/e2e

- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()

e2e-traces:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Checkout repo
uses: actions/checkout@v4

- name: Prepare Test
uses: "./.github/template/prepare-test"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Test
uses: "./.github/template/prepare-test"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: make run-e2e-test-traces
- name: Run tests
run: bin/ginkgo run --tags e2e --label-filter="traces" test/e2e

- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()

e2e-logs-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Checkout repo
uses: actions/checkout@v4

- name: Prepare Test
uses: "./.github/template/prepare-test"
with:
release: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Test
uses: "./.github/template/prepare-test"
with:
release: true
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: make run-e2e-test-logs
- name: Run tests
run: bin/ginkgo run --tags e2e --label-filter="logs" test/e2e

- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()

e2e-logs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Checkout repo
uses: actions/checkout@v4

- name: Prepare Test
uses: "./.github/template/prepare-test"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Test
uses: "./.github/template/prepare-test"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: make run-e2e-test-logs
- name: Run tests
run: bin/ginkgo run --tags e2e --label-filter="logs" test/e2e

- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()

e2e-telemetry-release:
runs-on: ubuntu-latest
Expand All @@ -150,7 +150,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: make run-e2e-test-telemetry
run: bin/ginkgo run --tags e2e --label-filter="telemetry" test/e2e

- name: Finalize Test
uses: "./.github/template/finalize-test"
Expand All @@ -170,7 +170,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: make run-e2e-test-telemetry
run: bin/ginkgo run --tags e2e --label-filter="telemetry" test/e2e

- name: Finalize Test
uses: "./.github/template/finalize-test"
Expand All @@ -181,19 +181,21 @@ jobs:
e2e-integration-istio:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Prepare Test
uses: "./.github/template/prepare-test"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: make run-integration-test-istio

- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
- name: Checkout repo
uses: actions/checkout@v4

- name: Prepare Test
uses: "./.github/template/prepare-test"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run tests
run: |
hack/deploy-istio.sh
bin/ginkgo run --tags istio test/integration/istio
- name: Finalize Test
uses: "./.github/template/finalize-test"
if: success() || failure()
with:
failure: failure()
Loading

0 comments on commit 3402365

Please sign in to comment.