Skip to content

Commit

Permalink
Run CI here automatically for every new PR to master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
frenzymadness committed Dec 13, 2022
1 parent ff7f5d6 commit e81ac6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 32 deletions.
22 changes: 6 additions & 16 deletions .github/workflows/container-tests.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: Container tests

on:
issue_comment:
types:
- created
pull_request:
branches:
- 'master'
jobs:
distgen-check:
name: "Check distgen generated files"
runs-on: ubuntu-20.04
if: |
github.event.issue.pull_request
&& (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]'))
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: "refs/pull/${{ github.event.issue.number }}/head"
submodules: true

- name: Check distgen generated files
Expand Down Expand Up @@ -50,7 +47,6 @@ jobs:
container-tests:
needs: distgen-check
# This job only runs for '[test]' pull request comments by owner, member
name: "Container tests: ${{ matrix.version }} - ${{ matrix.context }}"
runs-on: ubuntu-20.04
strategy:
Expand Down Expand Up @@ -113,15 +109,9 @@ jobs:
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]'))
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: "refs/pull/${{ github.event.issue.number }}/head"

- name: Prepare needed variables
shell: bash
Expand Down Expand Up @@ -157,5 +147,5 @@ jobs:
tf_scope: ${{ matrix.tf_scope }}
tmt_plan_regex: ${{ matrix.tmt_plan }}
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"
variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.number }};SINGLE_VERSION=${{ matrix.version }};OS=${{ matrix.os_test }};TEST_NAME=test"
compose: ${{ matrix.compose }}
23 changes: 7 additions & 16 deletions .github/workflows/openshift-tests.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: Openshift tests

on:
issue_comment:
types:
- created
pull_request:
branches:
- 'master'

jobs:
distgen-check:
name: "Check distgen generated files"
runs-on: ubuntu-20.04
if: |
github.event.issue.pull_request
&& (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]'))
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: "refs/pull/${{ github.event.issue.number }}/head"
submodules: true

- name: Check distgen generated files
Expand All @@ -28,7 +26,6 @@ jobs:
openshift-tests:
needs: distgen-check
# This job only runs for '[test-all]' or '[test-openshift] pull request comments by owner, member
name: "OpenShift tests: ${{ matrix.version }} - ${{ matrix.context }}"
runs-on: ubuntu-20.04
strategy:
Expand Down Expand Up @@ -82,15 +79,9 @@ jobs:
tmt_repo: "https://gitlab.cee.redhat.com/platform-eng-core-services/sclorg-tmt-plans"
tf_scope: "private"

if: |
github.event.issue.pull_request
&& (contains(github.event.comment.body, '[test-openshift]') || contains(github.event.comment.body, '[test-all]'))
&& contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association)
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: "refs/pull/${{ github.event.issue.number }}/head"

- name: Prepare needed variables
shell: bash
Expand Down Expand Up @@ -126,5 +117,5 @@ jobs:
tf_scope: ${{ matrix.tf_scope }}
tmt_plan_regex: ${{ matrix.tmt_plan }}
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 }}"
variables: "REPO_URL=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY;REPO_NAME=$GITHUB_REPOSITORY;PR_NUMBER=${{ github.event.number }};SINGLE_VERSION=${{ matrix.version }};OS=${{ matrix.os_test }};TEST_NAME=${{ matrix.test_name }}"
compose: ${{ matrix.compose }}

0 comments on commit e81ac6f

Please sign in to comment.