Skip to content

Commit

Permalink
Cherry pick of order CI workflows (#254)
Browse files Browse the repository at this point in the history
* Cherry pick: kyma-project/serverless#1079

* Cherry pick: kyma-project/serverless#1080

* Cherry pick: kyma-project/serverless#1081

* Cherry pick: kyma-project/serverless#1086

* Cherry pick: kyma-project/serverless#1087

* Adjust integration test GA for Warden

* Add missing permissions for build workflow
  • Loading branch information
MichalKalke authored Aug 12, 2024
1 parent e354ce5 commit fad9a0b
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 90 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: warden bbuild (push)
name: build
on:
push:
branches: ["main", "release-*"]
tags:
- '^v?\d+\.\d+\.\d+(?:-.*)?$'
permissions:
id-token: write # This is required for requesting the JWT token
contents: read # This is required for actions/checkout
workflow_call:

jobs:
compute-tags:
Expand All @@ -16,7 +10,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get the latest tag
- if: ${{ github.event_name == 'push' }}
name: Get the latest tag
id: get_tag
run: |
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: gitleaks
on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
workflow_call:

env:
GITLEAKS_VERSION: 8.18.2
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/_integration-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: integration tests

on:
workflow_call:
inputs:
directory-version:
description: 'The image directory to test'
required: true
type: string
image-version:
description: 'The image version to test'
required: true
type: string

jobs:
integration-test:
if: ${{ github.event_name == 'push' || github.event.pull_request.draft == false}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rebase
- uses: ./.github/actions/create-k3d-cluster
- uses: ./.github/actions/setup-go
- name: run test
run: make verify-on-cluster
env:
IMG_DIRECTORY: ${{inputs.directory-version}}
IMG_VERSION: ${{inputs.image-version}}
- name: show warden logs
if: failure()
run: kubectl logs -l app=warden -n kyma-system --prefix=true;
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: unit tests

on:
pull_request:
paths-ignore:
- '**.md'
types: [opened, reopened, synchronize, ready_for_review, converted_to_draft]
workflow_call:

jobs:
unit-tests:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: upgrade test

on:
push:
branches: [ "main" ]
workflow_call:

jobs:
upgrade-test:
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/build-pull.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/integration-tests-pull.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/integration-tests-push.yaml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/pull.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: pull

on:
pull_request_target:
types: [ opened, edited, synchronize, reopened, ready_for_review ]

permissions:
id-token: write # This is required for requesting the JWT token
contents: read # This is required for actions/checkout

jobs:
unit-tests:
uses: ./.github/workflows/_unit-tests.yaml

gitleaks:
uses: ./.github/workflows/_gitleaks.yaml

builds:
needs: [unit-tests, gitleaks]
uses: ./.github/workflows/_build.yaml

integrations:
needs: builds
uses: ./.github/workflows/_integration-tests.yaml
with:
directory-version: dev
image-version: ${{ github.event.number }}
20 changes: 20 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: push

on:
push:
branches: [ "main", "release-*" ]

jobs:
builds:
uses: ./.github/workflows/_build.yaml

integrations:
needs: builds
uses: ./.github/workflows/_integration-tests.yaml
with:
directory-version: prod
image-version: ${{ github.sha }}

upgrades:
needs: builds
uses: ./.github/workflows/upgrade-tests.yaml
10 changes: 10 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: release

on:
push:
tags:
- '^v?\d+\.\d+\.\d+(?:-.*)?$'

jobs:
builds:
uses: ./.github/workflows/_build.yaml

0 comments on commit fad9a0b

Please sign in to comment.