Skip to content

Commit

Permalink
fix: Implement workflows status check functions
Browse files Browse the repository at this point in the history
  • Loading branch information
vr-varad committed Sep 24, 2024
1 parent 59ef25f commit c434129
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 9 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,10 @@ jobs:
header: pr-title-lint-error
delete: true

# Log the result of linting
- name: Log lint status
run: |
if [ "${{ steps.lint_pr_title.outputs.error_message }}" == "" ]; then
echo "Linting passed successfully!";
else
echo "Linting failed with message: ${{ steps.lint_pr_title.outputs.error_message }}";
fi
if: ${{ success() && steps.lint_pr_title.outputs.error_message == '' }}
run: echo "PR title is valid"

links:
runs-on: ubuntu-latest
name: Validate PR to Issue link
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ jobs:
tag: true
commit: true

- name: Check Release Status
if: ${{ success() }}
run: echo "Release was successfull."

- name: Open PR for release branch
id: pr-step
uses: peter-evans/[email protected]
Expand All @@ -40,6 +44,10 @@ jobs:
body: "This PR contains the latest release changes."
draft: false
base: main

- name: Check PR Creation Status
if: ${{ success() }}
run: echo "Pull request created successfully"

- uses: peter-evans/enable-pull-request-automerge@v3
with:
Expand All @@ -56,3 +64,7 @@ jobs:
--title="v${{ steps.release-step.outputs.version }}" \
--target="release/${{ steps.release-step.outputs.version }}" \
--generate-notes
- name: Check Release Creation Status
if: ${{ success() }}
run: echo "Release created successfully with tag"
14 changes: 14 additions & 0 deletions .github/workflows/sync-keep-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v2

- name: Check Checkout Status
if: ${{ success() }}
run: echo "Repository checked out successfully."

- name: Run Keep CLI
run: |
keep workflow apply -f examples/workflows
- name: Check Keep CLI Status
if: ${{ success() }}
run: echo "Keep CLI command executed successfully."

- name: Handle Keep CLI Failure
if: ${{ failure() }}
run: |
echo "Keep CLI command failed. Please check the logs for details."
exit 1
17 changes: 16 additions & 1 deletion .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check Checkout Status
if: ${{ success() }}
run: echo "Repository checked out successfully."
- uses: chartboost/ruff-action@v1
with:
src: "./keep"
- name: Check Ruff Linter Status
if: ${{ success() }}
run: echo "Ruff linter ran successfully."
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
Expand All @@ -37,4 +43,13 @@ jobs:
python3 docs_get_providers_list.py --validate;
# Todo: validate if openapi schema is matching with the code
- name: Check Documentation Validation Status
if: ${{ success() }}
run: echo "Documentation validation commands executed successfully."

- name: Handle Documentation Validation Failure
if: ${{ failure() }}
run: |
echo "Documentation validation failed. Please check the logs for details."
exit 1
24 changes: 24 additions & 0 deletions .github/workflows/test-pr-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Check Checkout Status
if: ${{ success() }}
run: echo "Repository checked out successfully."

- uses: chartboost/ruff-action@v1
with:
src: "./keep"

- name: Check Ruff Linter Status
if: ${{ success() }}
run: echo "Ruff linter ran successfully."

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
Expand All @@ -59,13 +67,25 @@ jobs:

- name: Install dependencies using poetry
run: poetry install --no-interaction --no-root --with dev

- name: Check Poetry Installation Status
if: ${{ success() }}
run: echo "Poetry dependencies installed successfully."

- name: Install Playwright dependencies
run: npx playwright install --with-deps

- name: Check Playwright Installation Status
if: ${{ success() }}
run: echo "Playwright dependencies installed successfully.

- name: Install playwright
run: poetry run playwright install

- name: Check Playwright Installation Status
if: ${{ success() }}
run: echo "Playwright installed successfully."

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

Expand Down Expand Up @@ -127,6 +147,10 @@ jobs:
- name: Run e2e tests and report coverage
run: |
poetry run coverage run --branch -m pytest -s tests/e2e_tests/
- name: Check E2E Test Status
if: ${{ success() }}
run: echo "E2E tests executed successfully."

- name: Convert coverage results to JSON (for CodeCov support)
run: poetry run coverage json --omit="keep/providers/*"
Expand Down

0 comments on commit c434129

Please sign in to comment.