From a76a467024fa181e7658a7e02b518bfe07475fef Mon Sep 17 00:00:00 2001 From: Maja Massarini Date: Mon, 17 Jun 2024 13:44:35 +0200 Subject: [PATCH] Add testing farm github action --- .github/workflows/tf-tests.yml | 37 ++++++++++++++++++++++++++++++++++ playbooks/oc-cluster-run.yml | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tf-tests.yml diff --git a/.github/workflows/tf-tests.yml b/.github/workflows/tf-tests.yml new file mode 100644 index 0000000..7910a0b --- /dev/null +++ b/.github/workflows/tf-tests.yml @@ -0,0 +1,37 @@ +name: Schedule test on Testing Farm +on: + pull_request_target: + types: + - assigned + - opened + - synchronize + - reopened +# on: +# issue_comment: +# types: +# - created + +# The concurrency key is used to prevent multiple workflows from running at the same time +concurrency: + group: my-concurrency-group + cancel-in-progress: true + +jobs: + tests: + runs-on: ubuntu-latest + # if: | + # github.event.issue.pull_request + # && contains(github.event.comment.body, '[test]') + # && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) + steps: + - name: Schedule test on Testing Farm + uses: sclorg/testing-farm-as-github-action@v2 + with: + api_key: ${{ secrets.TF_API_KEY }} + git_url: "https://github.com/majamassarini/deployment" + git_ref: "tf-openshift-tests" + tmt_plan_regex: "deployment" + pull_request_status_name: "Deployment" + create_issue_comment: true + timeout: 3600 + secrets: CRC_PULL_SECRET=${{ secrets.CRC_PULL_SECRET }} diff --git a/playbooks/oc-cluster-run.yml b/playbooks/oc-cluster-run.yml index f9bba11..5655ac5 100644 --- a/playbooks/oc-cluster-run.yml +++ b/playbooks/oc-cluster-run.yml @@ -5,7 +5,7 @@ become_user: tmt gather_facts: False vars: - pull_secret: "!!!TAKEN FROM ANSIBLE ENV!!!" + pull_secret: "{{ pull_secret }} if ( pull_secret ) else {{ lookup('env', 'CRC_PULL_SECRET') }}" dest_pull_secret_file: /tmp/openshift-local-pull-secret.txt crc_path: /home/tmt/.local/bin tasks: