mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-29 09:00:26 -05:00
98 lines
3.1 KiB
YAML
98 lines
3.1 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '0 4 * * 1,2,3,4,5'
|
|
workflow_call:
|
|
inputs:
|
|
report-status:
|
|
description: "Report status of the jobs in outputs"
|
|
type: string
|
|
required: false
|
|
default: false
|
|
outputs:
|
|
frontend_status:
|
|
description: "Status of the frontend job"
|
|
value: ${{ jobs.set-frontend-status.outputs.frontend_status }}
|
|
backend_status:
|
|
description: "Status of the backend job"
|
|
value: ${{ jobs.set-backend-status.outputs.backend_status }}
|
|
|
|
jobs:
|
|
file-changes:
|
|
name: File changes detection
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 60
|
|
outputs:
|
|
ui: ${{ steps.changes.outputs.ui }}
|
|
backend: ${{ steps.changes.outputs.backend }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
if: "!startsWith(github.ref, 'refs/tags/v')"
|
|
- uses: dorny/paths-filter@v3
|
|
if: "!startsWith(github.ref, 'refs/tags/v')"
|
|
id: changes
|
|
with:
|
|
filters: |
|
|
ui:
|
|
- 'ui/**'
|
|
backend:
|
|
- '!{ui,.github}/**'
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
frontend:
|
|
name: Frontend - Tests
|
|
needs: file-changes
|
|
if: "needs.file-changes.outputs.ui == 'true' || startsWith(github.ref, 'refs/tags/v')"
|
|
uses: ./.github/workflows/workflow-frontend-test.yml
|
|
secrets:
|
|
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
|
|
backend:
|
|
name: Backend - Tests
|
|
needs: file-changes
|
|
if: "needs.file-changes.outputs.backend == 'true' || startsWith(github.ref, 'refs/tags/v')"
|
|
uses: ./.github/workflows/workflow-backend-test.yml
|
|
secrets:
|
|
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
GOOGLE_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_SERVICE_ACCOUNT }}
|
|
|
|
# Output every job status
|
|
# To be used in other workflows
|
|
report-status:
|
|
name: Report Status
|
|
runs-on: ubuntu-latest
|
|
needs: [ frontend, backend ]
|
|
if: always() && (inputs.report-status == 'true')
|
|
outputs:
|
|
frontend_status: ${{ steps.set-frontend-status.outputs.frontend_status }}
|
|
backend_status: ${{ steps.set-backend-status.outputs.backend_status }}
|
|
steps:
|
|
- id: set-frontend-status
|
|
name: Set frontend job status
|
|
run: echo "::set-output name=frontend_status::${{ needs.frontend.result }}"
|
|
|
|
- id: set-backend-status
|
|
name: Set backend job status
|
|
run: echo "::set-output name=backend_status::${{ needs.backend.result }}"
|
|
|
|
notify:
|
|
name: Notify - Slack
|
|
runs-on: ubuntu-latest
|
|
needs: [ frontend, backend ]
|
|
if: github.event_name == 'schedule'
|
|
steps:
|
|
- name: Notify failed CI
|
|
id: send-ci-failed
|
|
if: |
|
|
always() && (needs.frontend.result != 'success' ||
|
|
needs.backend.result != 'success')
|
|
uses: kestra-io/actions/.github/actions/send-ci-failed@main
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|