Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not run-tests if TEST_NAMES is empty #50

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .github/workflows/incluster-comp-pr-merged.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ on:
REQUIRED_TESTS:
required: true
type: string
description: 'tests to run'
description: 'tests to run'
COSIGN:
required: false
default: false
Expand All @@ -59,16 +59,16 @@ on:

jobs:
docker-build:
if: ${{ ((contains(github.event.pull_request.labels.*.name, 'release') || contains( github.event.pull_request.labels.*.name, 'trigger-integration-test')) && github.repository_owner == 'kubescape') || inputs.FORCE }}
if: ${{ ((contains(github.event.pull_request.labels.*.name, 'release') || contains( github.event.pull_request.labels.*.name, 'trigger-integration-test')) && github.repository_owner == 'kubescape') || inputs.FORCE }}
runs-on: ubuntu-latest
outputs:
IMAGE_TAG_PRERELEASE: ${{ steps.image-prerelease-tag.outputs.IMAGE_TAG_PRERELEASE }}
TEST_NAMES: ${{ steps.export_tests_to_env.outputs.TEST_NAMES }}
permissions:
id-token: write
packages: write
contents: read
pull-requests: read
contents: read
pull-requests: read

steps:

Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
- name: Run unit test
id: unit-test
run: go test -v ./...

- name: Login to Quay
uses: docker/login-action@v2
with:
Expand Down Expand Up @@ -141,10 +141,11 @@ jobs:

run-tests:
strategy:
fail-fast: false
fail-fast: false
matrix:
TEST: ${{ fromJson(needs.docker-build.outputs.TEST_NAMES) }}
needs: docker-build
if: ${{ needs.docker-build.outputs.TEST_NAMES != '' && toJson(fromJson(needs.docker-build.outputs.TEST_NAMES)) != '[]' }}
runs-on: ubuntu-latest
steps:

Expand All @@ -158,7 +159,7 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.8.13'
cache: 'pip'
cache: 'pip'

- name: create env
run: ./create_env.sh
Expand All @@ -174,7 +175,7 @@ jobs:
with:
cluster_name: ${{ steps.uuid.outputs.RANDOM_UUID }}
# kubectl_version: v1.23.12

- name: run-tests
env:
CUSTOMER: ${{ secrets.CUSTOMER }}
Expand Down Expand Up @@ -204,7 +205,7 @@ jobs:
uses: mikepenz/action-junit-report@v3.6.1
if: always() # always run even if the previous step fails
with:
report_paths: '**/results_xml_format/**.xml'
report_paths: '**/results_xml_format/**.xml'


create-release-and-retag:
Expand All @@ -213,7 +214,7 @@ jobs:
needs: [run-tests, docker-build]
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
runs-on: ubuntu-latest
runs-on: ubuntu-latest

steps:

Expand Down
Loading