Tests #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
frontend: | |
name: Frontend - Tests | |
uses: ./.github/workflows/workflow-frontend-test.yml | |
secrets: | |
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
backend: | |
name: Backend - Tests | |
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 }} |