Skip to content

Commit

Permalink
Merge pull request #454 from OasisDEX/triggering-e2e-tests-23-8
Browse files Browse the repository at this point in the history
Trigger workflow - test 2.27
  • Loading branch information
juan-langa authored Aug 23, 2024
2 parents e18a8ac + 6eb1019 commit e5f3021
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 20 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci_e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ on:
description: 'Run_id from oasis-borrow run that is triggering this workflow.'
type: string
required: true
# ########################
# testing 'tests failure' scenario
result:
description: 'Test result parameter introduced for testing failure scenario'
type: string
required: true
# 'result' input to be removed after testing'
# ########################

jobs:
ci-e2e-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: CI - Regression E2E tests for RUN_ID ${{ inputs.run_id }}
run: echo "Event received - RUN_ID is ${{ inputs.run_id }}"
- name: Check coverage tolerance
- name: CI - Regression E2E tests for oasis-borrow RUN_ID ${{ inputs.run_id }}
run: echo "Event received - oasis-borrow RUN_ID is ${{ inputs.run_id }}"
- name: Testing e2e tests fail - TO BE REMOVED after Testing
if: ${{ inputs.result == 'fail' }}
uses: actions/github-script@v7
with:
Expand Down
45 changes: 28 additions & 17 deletions .github/workflows/ci_e2e_tests_result.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
types: [completed]

jobs:
# ########################
# ## 'trigger-conclusion' and 'trigger-id' jobs TO BE REMOVED after TESTING
trigger-conclusion:
runs-on: ubuntu-latest
steps:
Expand All @@ -14,22 +16,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- run: echo 'CI E2E tests workflow ID is -- ${{ github.event.workflow_run.id }} --.'
trigger-run-number:
# ########################
tests-result:
runs-on: ubuntu-latest
steps:
- run: echo 'CI E2E tests workflow RUN NUMER is -- ${{ github.event.workflow_run.run_number }} --.'
on-ci-e2e-tests-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: echo 'CI E2E tests passed'
on-ci-e2e-tests-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'ci-e2e-tests failed'
on-ci-e2e-tests-cancellation:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'cancelled' }}
steps:
- run: echo 'ci-e2e-tests was cancelled'
- name: Triggering E2E tests result workflow in oasis-borrow repository
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.E2E_TESTS_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/OasisDEX/test-workflow-trigger/actions/workflows/e2e_tests_result.yml/dispatches \
-d "{\"ref\":\"main\", \"inputs\":{\"tests_run_id\":\"${{ github.event.workflow_run.id }}\", \"tests_result\":\"${{ github.event.workflow_run.conclusion }}\"}}"
- name: Test results failed
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
uses: actions/github-script@v7
with:
script: |
core.setFailed('E2E tests failed')
- name: Test results passed
if: ${{ github.event.workflow_run.conclusion == 'success' }}
run: echo 'CI E2E tests passed'

# on-ci-e2e-tests-failure:
# runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'failure' }}
# steps:
# - run: echo 'ci-e2e-tests failed'

0 comments on commit e5f3021

Please sign in to comment.