From 10fc5e46eb47e12e32b37166cce2d7e6fbe17e16 Mon Sep 17 00:00:00 2001 From: "Petr \"Stone\" Hracek" Date: Mon, 12 Sep 2022 10:25:33 +0200 Subject: [PATCH] Testing single versions for container and openshift tests Signed-off-by: Petr "Stone" Hracek --- .github/workflows/container-tests.yml | 49 ++++++++++++++++++++++----- .github/workflows/openshift-tests.yml | 37 ++++++++++++++++---- 2 files changed, 71 insertions(+), 15 deletions(-) diff --git a/.github/workflows/container-tests.yml b/.github/workflows/container-tests.yml index a94cad11..560e03cc 100644 --- a/.github/workflows/container-tests.yml +++ b/.github/workflows/container-tests.yml @@ -1,17 +1,17 @@ -name: Container-tests by GitHub Action at Testing Farm - on: issue_comment: types: - created jobs: - build: + container-tests: # This job only runs for '[test]' pull request comments by owner, member - name: Container-tests by GitHub Action on Testing Farm service runs-on: ubuntu-20.04 + name: "Container tests: ${{ matrix.version }} - ${{ matrix.context }}" strategy: fail-fast: false matrix: + version: [ "10", "11", "12", "13" ] + os_test: [ "fedora", "centos7", "rhel7", "rhel8", "rhel9", "c9s", "c8s"] include: - tmt_plan: "fedora" os_test: "fedora" @@ -33,8 +33,8 @@ jobs: compose: "RHEL-7.9-Released" api_key: "TF_INTERNAL_API_KEY" branch: "master" - tf_scope: "private" tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans" + tf_scope: "private" - tmt_plan: "rhel8-docker" os_test: "rhel8" context: "RHEL8" @@ -51,6 +51,14 @@ jobs: branch: "master" tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans" tf_scope: "private" + - tmt_plan: "rhel9-unsubscribed-docker" + os_test: "rhel9" + context: "RHEL9 - Unsubscribed host" + compose: "RHEL-9.0.0-Nightly" + api_key: "TF_INTERNAL_API_KEY" + branch: "master" + tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans" + tf_scope: "private" - tmt_plan: "c9s" os_test: "c9s" context: "CentOS Stream 9" @@ -65,6 +73,7 @@ jobs: api_key: "TF_PUBLIC_API_KEY" branch: "main" tmt_repo: "https://github.com/sclorg/sclorg-testing-farm" + if: | github.event.issue.pull_request && (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]')) @@ -75,8 +84,32 @@ jobs: with: ref: "refs/pull/${{ github.event.issue.number }}/head" + - name: Prepare needed variables + shell: bash + id: vars + run: | + dockerfile="Dockerfile.${{ matrix.os_test }}" + if [[ ${{ matrix.os_test }} == "centos7" ]]; then + dockerfile="Dockerfile" + fi + echo "::set-output name=DOCKERFILE_NAME::${dockerfile}" + + - name: Check that ${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }} is present + id: check_dockerfile + uses: andstor/file-existence-action@v1 + with: + files: "${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }}" + + - name: Check that .exclude-${{ matrix.os_test }} file is not present + id: check_exclude_file + uses: andstor/file-existence-action@v1 + with: + files: "${{ matrix.version }}/.exclude-${{ matrix.os_test }}" + # https://github.com/sclorg/testing-farm-as-github-action - - name: Schedule tests on external Testing Farm by Testing-Farm-as-github-action + - name: Schedule tests for ${{ matrix.version }} - ${{ matrix.context }} + id: github_action + if: ${{ steps.check_exclude_file.outputs.files_exists == 'false' && steps.check_dockerfile.outputs.files_exists == 'true' }} uses: sclorg/testing-farm-as-github-action@v1 with: api_key: ${{ secrets[matrix.api_key] }} @@ -84,6 +117,6 @@ jobs: git_ref: ${{ matrix.branch }} tf_scope: ${{ matrix.tf_scope }} tmt_plan_regex: ${{ matrix.tmt_plan }} - pull_request_status_name: ${{ matrix.context }} - variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.issue.number }};OS=${{ matrix.os_test }};TEST_NAME=test" + pull_request_status_name: "${{ matrix.context }} - ${{ matrix.version }}" + variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.issue.number }};SINGLE_VERSION=${{ matrix.version }};OS=${{ matrix.os_test }};TEST_NAME=test" compose: ${{ matrix.compose }} diff --git a/.github/workflows/openshift-tests.yml b/.github/workflows/openshift-tests.yml index 52f8fa0c..3950456c 100644 --- a/.github/workflows/openshift-tests.yml +++ b/.github/workflows/openshift-tests.yml @@ -1,17 +1,17 @@ -name: OpenShift tests by GitHub Action at Testing Farm - on: issue_comment: types: - created jobs: - build: + openshift-tests: # This job only runs for '[test-all]' or '[test-openshift] pull request comments by owner, member - name: OpenShift tests by GitHub Action on Testing Farm service + name: "OpenShift tests: ${{ matrix.version }} - ${{ matrix.context }}" runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: + version: [ "10", "11", "12", "13" ] + os_test: [ "centos7", "rhel7", "rhel8", "rhel9"] include: - tmt_plan: "centos7" os_test: "centos7" @@ -68,9 +68,32 @@ jobs: with: ref: "refs/pull/${{ github.event.issue.number }}/head" + - name: Prepare needed variables + shell: bash + id: vars + run: | + dockerfile="Dockerfile.${{ matrix.os_test }}" + if [[ ${{ matrix.os_test }} == "centos7" ]]; then + dockerfile="Dockerfile" + fi + echo "::set-output name=DOCKERFILE_NAME::${dockerfile}" + + - name: Check that ${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }} is present + id: check_dockerfile + uses: andstor/file-existence-action@v1 + with: + files: "${{ matrix.version }}/${{ steps.vars.outputs.DOCKERFILE_NAME }}" + + - name: Check that .exclude-${{ matrix.os_test }} file is not present + id: check_exclude_file + uses: andstor/file-existence-action@v1 + with: + files: "${{ matrix.version }}/.exclude-${{ matrix.os_test }}" + # https://github.com/sclorg/testing-farm-as-github-action - - name: Schedule tests on external Testing Farm by Testing-Farm-as-github-action + - name: Schedule tests for ${{ matrix.version }} - ${{ matrix.context }} id: github_action + if: ${{ steps.check_exclude_file.outputs.files_exists == 'false' && steps.check_dockerfile.outputs.files_exists == 'true' }} uses: sclorg/testing-farm-as-github-action@v1 with: api_key: ${{ secrets[matrix.api_key] }} @@ -78,6 +101,6 @@ jobs: git_ref: ${{ matrix.branch }} tf_scope: ${{ matrix.tf_scope }} tmt_plan_regex: ${{ matrix.tmt_plan }} - pull_request_status_name: ${{ matrix.context }} - variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.issue.number }};OS=${{ matrix.os_test }};TEST_NAME=${{ matrix.test_name }}" + pull_request_status_name: "${{ matrix.context }} - ${{ matrix.version }}" + variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.issue.number }};SINGLE_VERSION=${{ matrix.version }};OS=${{ matrix.os_test }};TEST_NAME=${{ matrix.test_name }}" compose: ${{ matrix.compose }}