chore(ci): initial work #243
Workflow file for this run
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: Pull Request Workflow | |
on: | |
pull_request: | |
branches: | |
- develop | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
labeling: | |
name: PR Labeling & Project Assignment | |
runs-on: ubuntu-latest | |
# if: github.event.action == 'opened' | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get PR Author | |
id: pr_author | |
run: echo "PR_AUTHOR=$(gh pr view ${{ github.event.pull_request.html_url }} --json author --jq '.author.login')" >> $GITHUB_ENV | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add PR to Project | |
id: project_add | |
run: | | |
ITEM_ID=$(gh project item-add 16 --owner kestra-io --url https://github.com/kestra-io/kestra/pull/7447 | grep -oP '"id":\s*\K\d+') | |
echo "ITEM_ID=$ITEM_ID" >> $GITHUB_ENV | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add Label to PR | |
run: gh pr edit ${{ github.event.pull_request.number }} --add-label "needs-review" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
file-changes: | |
name: File changes detection | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
outputs: | |
ui: ${{ steps.changes.outputs.ui }} | |
translations: ${{ steps.changes.outputs.translations }} | |
backend: ${{ steps.changes.outputs.backend }} | |
steps: | |
- uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: | | |
ui: | |
- 'ui/**' | |
translations: | |
- 'ui/src/translations/**' | |
backend: | |
- '!{ui,.github}/**' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
translations: | |
name: 'Translations - Generate translations' | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
needs: file-changes | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout - Current ref | |
if: "needs.file-changes.outputs.translations == 'true'" | |
- id: generate-translations | |
name: Translations - Generate translations | |
if: "needs.file-changes.outputs.translations == 'true'" | |
uses: ./.github/actions/generate-translations | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
env: | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
frontend: | |
name: Frontend - Tests | |
needs: [file-changes, translations] | |
if: "needs.file-changes.outputs.ui == 'true'" | |
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'" | |
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 }} | |
end: | |
name: End | |
runs-on: ubuntu-latest | |
if: always() | |
needs: [frontend, backend] | |
steps: | |
# Slack | |
- name: Slack notification | |
uses: Gamesight/slack-workflow-status@master | |
if: ${{ always() && env.SLACK_WEBHOOK_URL != 0 }} | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} | |
name: GitHub Actions | |
icon_emoji: ":github-actions:" | |
channel: "C02DQ1A7JLR" |