diff --git a/.github/actions/collect-cluster-info/action.yaml b/.github/actions/collect-cluster-info/action.yaml new file mode 100644 index 000000000..fb5a1d69c --- /dev/null +++ b/.github/actions/collect-cluster-info/action.yaml @@ -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 diff --git a/.github/workflows/create-release.yaml b/.github/workflows/create-release.yaml index 48e73df52..cbd783131 100644 --- a/.github/workflows/create-release.yaml +++ b/.github/workflows/create-release.yaml @@ -1,4 +1,4 @@ -name: "Create release" +name: create release on: workflow_dispatch: diff --git a/.github/workflows/pull-gitleaks.yaml b/.github/workflows/gitleaks.yaml similarity index 97% rename from .github/workflows/pull-gitleaks.yaml rename to .github/workflows/gitleaks.yaml index baecdfa4f..2b2575322 100644 --- a/.github/workflows/pull-gitleaks.yaml +++ b/.github/workflows/gitleaks.yaml @@ -1,4 +1,4 @@ -name: pull-gitleaks +name: gitleaks on: pull_request: types: [opened, edited, synchronize, reopened, ready_for_review] diff --git a/.github/workflows/images-verify.yaml b/.github/workflows/images-verify.yaml index a112adcc1..89d5a6e89 100644 --- a/.github/workflows/images-verify.yaml +++ b/.github/workflows/images-verify.yaml @@ -1,4 +1,4 @@ -name: Images verify +name: images verify run-name: ${{github.event.pull_request.title}} on: pull_request: diff --git a/.github/workflows/integration-tests-pull.yaml b/.github/workflows/integration-tests-pull.yaml new file mode 100644 index 000000000..6a58463b3 --- /dev/null +++ b/.github/workflows/integration-tests-pull.yaml @@ -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 }} diff --git a/.github/workflows/operator-verify.yaml b/.github/workflows/integration-tests-push.yaml similarity index 59% rename from .github/workflows/operator-verify.yaml rename to .github/workflows/integration-tests-push.yaml index d95096883..0b5620eec 100644 --- a/.github/workflows/operator-verify.yaml +++ b/.github/workflows/integration-tests-push.yaml @@ -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: @@ -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 }} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 1f24e49c1..d2cf060cb 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -1,4 +1,4 @@ -name: Lint test +name: lint on: pull_request: @@ -6,12 +6,7 @@ on: - '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: diff --git a/.github/workflows/markdown.yaml b/.github/workflows/markdown.yaml index 532131405..acee96c7f 100644 --- a/.github/workflows/markdown.yaml +++ b/.github/workflows/markdown.yaml @@ -1,4 +1,4 @@ -name: Markdown +name: markdown run-name: ${{github.event.pull_request.title}} on: schedule: diff --git a/.github/workflows/promote-to-release-channel.yaml b/.github/workflows/promote-to-release-channel.yaml index 8f5151fcf..504a8b71a 100644 --- a/.github/workflows/promote-to-release-channel.yaml +++ b/.github/workflows/promote-to-release-channel.yaml @@ -1,4 +1,4 @@ -name: "Promote serverless to release channel" +name: promote to release channel on: workflow_dispatch: diff --git a/.github/workflows/serverless-verify.yaml b/.github/workflows/serverless-verify.yaml deleted file mode 100644 index b736c095d..000000000 --- a/.github/workflows/serverless-verify.yaml +++ /dev/null @@ -1,83 +0,0 @@ -name: Serverless verify - -on: - push: - branches: [ "main", "release-*" ] - pull_request: - paths-ignore: - - 'docs/**' - - 'examples/**' - types: - - opened - - reopened - - synchronize - - ready_for_review - - converted_to_draft - -jobs: - serverless-unit-tests: - if: github.event_name == 'pull_request' - 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 - - serverless-integration-test: - runs-on: ubuntu-latest - if: github.event.pull_request.draft == false - 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 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 }} - - name: run integration test (post) - if: github.event_name == 'push' - 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: - if: github.event_name == 'push' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup-go - - uses: ./.github/actions/create-single-cluster - - name: run git auth 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 }} - - serverless-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 - 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 }} diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml new file mode 100644 index 000000000..0a57af9cc --- /dev/null +++ b/.github/workflows/unit-tests.yaml @@ -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 + diff --git a/.github/workflows/upgrade-tests.yaml b/.github/workflows/upgrade-tests.yaml new file mode 100644 index 000000000..00086409c --- /dev/null +++ b/.github/workflows/upgrade-tests.yaml @@ -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 }}