Skip to content

Commit

Permalink
extract common pull/push part in verification github actions (#963)
Browse files Browse the repository at this point in the history
  • Loading branch information
anoipm authored May 9, 2024
1 parent bb88a40 commit 4177a0c
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 149 deletions.
10 changes: 10 additions & 0 deletions .github/actions/collect-cluster-info/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Collect cluster-info'
description: 'Action for collecting cluster-info'

runs:
using: 'composite'
steps:
- name: collect cluster-info
if: ${{ always() }}
run: make -C tests/operator cluster-info
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Create release"
name: create release

on:
workflow_dispatch:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pull-gitleaks
name: gitleaks
on:
pull_request:
types: [opened, edited, synchronize, reopened, ready_for_review]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/images-verify.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Images verify
name: images verify
run-name: ${{github.event.pull_request.title}}
on:
pull_request:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/integration-tests-pull.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: integration tests (pull)

on:
pull_request:
paths-ignore:
- 'docs/**'
- 'examples/**'
types: [opened, reopened, synchronize, ready_for_review, converted_to_draft]

jobs:
operator-integration-test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: run test
run: |
make -C components/operator deploy
make -C tests/operator test
env:
IMG: europe-docker.pkg.dev/kyma-project/dev/serverless-operator:PR-${{ github.event.number }}
- uses: ./.github/actions/collect-cluster-info

serverless-integration-test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: run test
run: |
make install-serverless-custom-operator
make -C tests/serverless serverless-integration serverless-contract-tests
make remove-serverless
env:
IMG: europe-docker.pkg.dev/kyma-project/dev/serverless-operator:PR-${{ github.event.number }}
Original file line number Diff line number Diff line change
@@ -1,80 +1,30 @@
name: Operator verify
name: integration tests (push)

on:
push:
branches: [ "main", "release-*" ]
pull_request:
paths-ignore:
- 'docs/**'
- 'examples/**'
types:
- opened
- reopened
- synchronize
- ready_for_review
- converted_to_draft

jobs:
operator-unit-tests:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- name: run test
run: make -C components/operator test

operator-integration-test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: run integration test (pre)
if: github.event_name == 'pull_request'
run: |
make -C components/operator deploy
make -C tests/operator test
env:
IMG: europe-docker.pkg.dev/kyma-project/dev/serverless-operator:PR-${{ github.event.number }}
- name: run integration test (post)
if: github.event_name == 'push'
run: |
make -C components/operator deploy
make -C tests/operator test
env:
IMG: europe-docker.pkg.dev/kyma-project/prod/serverless-operator:${{ github.sha }}
- name: collect cluster-info
if: ${{ always() }}
run: make -C tests/operator cluster-info

operator-upgrade-test:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: upgrade test
- name: run test
run: |
make -C components/operator deploy-release
make -C tests/operator test
make -C components/operator deploy
make -C tests/operator test
env:
IMG: europe-docker.pkg.dev/kyma-project/prod/serverless-operator:${{ github.sha }}
- name: collect cluster-info
if: ${{ always() }}
run: make -C tests/operator cluster-info
- uses: ./.github/actions/collect-cluster-info

gardener-integration-test:
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- name: save sa
- name: save service-account
shell: bash
run: 'echo "$GARDENER_SA" > /tmp/gardener-sa.yaml'
env:
Expand All @@ -96,3 +46,34 @@ jobs:
run: make -C hack deprovision-gardener
env:
GARDENER_SA_PATH: /tmp/gardener-sa.yaml

serverless-integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: run test
run: |
make install-serverless-custom-operator
make -C tests/serverless serverless-integration serverless-contract-tests
make remove-serverless
env:
IMG: europe-docker.pkg.dev/kyma-project/prod/serverless-operator:${{ github.sha }}

git-auth-integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: run tests
run: |
make install-serverless-custom-operator
make -C tests/serverless git-auth-integration
make remove-serverless
env:
APP_TEST_GITHUB_SSH_AUTH_KEY: ${{ secrets.GIT_AUTH_TEST_GITHUB_SSH_KEY }}
APP_TEST_AZURE_BASIC_AUTH_USERNAME: ${{ secrets.GIT_AUTH_TEST_AZURE_USERNAME }}
APP_TEST_AZURE_BASIC_AUTH_PASSWORD: ${{ secrets.GIT_AUTH_TEST_AZURE_PASSWORD }}
IMG: europe-docker.pkg.dev/kyma-project/prod/serverless-operator:${{ github.sha }}
9 changes: 2 additions & 7 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
name: Lint test
name: lint

on:
pull_request:
paths:
- 'components/operator/**'
- 'components/serverless/**'
- '.github/**'
types:
- opened
- reopened
- synchronize
- ready_for_review
- converted_to_draft
types: [opened, reopened, synchronize, ready_for_review, converted_to_draft]

jobs:
operator-lint:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Markdown
name: markdown
run-name: ${{github.event.pull_request.title}}
on:
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/promote-to-release-channel.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Promote serverless to release channel"
name: promote to release channel

on:
workflow_dispatch:
Expand Down
83 changes: 0 additions & 83 deletions .github/workflows/serverless-verify.yaml

This file was deleted.

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

on:
pull_request:
paths-ignore:
- 'docs/**'
- 'examples/**'
types: [opened, reopened, synchronize, ready_for_review, converted_to_draft]

jobs:
operator-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- name: run test
run: make -C components/operator test

serverless-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-libgit2
- name: run test
run: make -C components/serverless test

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

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

jobs:
operator-upgrade-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: upgrade test
run: |
make -C components/operator deploy-release
make -C tests/operator test
make -C components/operator deploy
make -C tests/operator test
env:
IMG: europe-docker.pkg.dev/kyma-project/prod/serverless-operator:${{ github.sha }}
- uses: ./.github/actions/collect-cluster-info

serverless-upgrade-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/create-single-cluster
- name: upgrade test
run: |
make install-serverless-latest-release install-serverless-custom-operator
make -C tests/serverless serverless-integration serverless-contract-tests
make remove-serverless
env:
IMG: europe-docker.pkg.dev/kyma-project/prod/serverless-operator:${{ github.sha }}

0 comments on commit 4177a0c

Please sign in to comment.