DocsGithubWorkflows RéutilisablesWorkflows Réutilisables Assurez-vous d’avoir lu CI/CD avec Mélodium au préalable. Workflow Réutilisable Des workflows réutilisables GitHub Actions sont disponibles pour exécuter Mélodium dans les runners GitHub : Mélodium Reusable Workflows . Mélodium sur GitHub Actions La configuration à ajouter dans le YAML GitHub est : jobs: melodium: uses: melodium-tech/github-actions/.github/workflows/melodium.yml@v0.10 with: command: run .melodium-ci/Compo.toml --api_token <YOUR_RUN_API_TOKEN> --output_directory logs --repository_clone_url "${{ github.repositoryUrl }}" --repository_clone_ref "${{ github.ref_name }}" --on_github true --ci_service_token "${{ github.token }}" --ci_service_project "${{ github.repository }}" --ci_service_sha "${{ github.sha }}" artifact-path: 'logs/' secrets: token: ${{ secrets.token }} Référez-vous à melodium.yml pour la liste complète des paramètres d’entrée. Distribuer le travail dans un runner GA Un workflow réutilisable pour exécuter Mélodium avec distribution locale est disponible : jobs: melodium: uses: melodium-tech/github-actions/.github/workflows/melodium-local-distrib.yml@v0.10 with: command: run .melodium-ci/Compo.toml --work_location compose --api_token <YOUR_RUN_API_TOKEN> --output_directory logs --repository_clone_url "${{ github.repositoryUrl }}" --repository_clone_ref "${{ github.ref_name }}" --on_github true --ci_service_token "${{ github.token }}" --ci_service_project "${{ github.repository }}" --ci_service_sha "${{ github.sha }}" artifact-path: 'logs/' secrets: token: ${{ secrets.token }} L’utilisation de la distribution locale dans GitHub Actions permet de tirer pleinement parti des runners fournis sans dépendre d’un cluster supplémentaire. Référez-vous à melodium-local-distrib.yml pour la liste complète des paramètres d’entrée. Runner Windows Un workflow réutilisable pour exécuter Mélodium sur un runner Windows est disponible : jobs: melodium: uses: melodium-tech/github-actions/.github/workflows/melodium-windows.yml@v0.10 with: command: run .melodium-ci/Compo.toml --api_token <YOUR_RUN_API_TOKEN> --output_directory logs --repository_clone_url "${{ github.repositoryUrl }}" --repository_clone_ref "${{ github.ref_name }}" --on_github true --ci_service_token "${{ github.token }}" --ci_service_project "${{ github.repository }}" --ci_service_sha "${{ github.sha }}" artifact-path: 'logs/' secrets: token: ${{ secrets.token }} Référez-vous à melodium-windows.yml pour la liste complète des paramètres d’entrée. Runner Mac OS Un workflow réutilisable pour exécuter Mélodium sur un runner Mac OS est disponible : jobs: melodium: uses: melodium-tech/github-actions/.github/workflows/melodium-macos.yml@v0.10 with: command: run .melodium-ci/Compo.toml --api_token <YOUR_RUN_API_TOKEN> --output_directory logs --repository_clone_url "${{ github.repositoryUrl }}" --repository_clone_ref "${{ github.ref_name }}" --on_github true --ci_service_token "${{ github.token }}" --ci_service_project "${{ github.repository }}" --ci_service_sha "${{ github.sha }}" artifact-path: 'logs/' secrets: token: ${{ secrets.token }} Référez-vous à melodium-macos.yml pour la liste complète des paramètres d’entrée. Remonter un statut vers GitHub Pour remonter des statuts de commit vers GitHub, différentes méthodes sont disponibles. Avec simpleStep Dans un traitement simpleStep, ajoutez les paramètres suivants : simpleStep( /* … */ github=true, github_token=/* Token GitHub avec accès API */, github_project=/* Projet GitHub */, github_sha=/* SHA GitHub associé à l'étape */ ) Dans le template CI/CD, dans le traitement main : build: simpleStep[cicd=cicd]( /* … */ github=on_github, github_token=ci_service_token, github_project=ci_service_project, github_sha=ci_service_sha ) /* … */ test: simpleStepWithInput[cicd=cicd]( /* … */ github=on_github, github_token=ci_service_token, github_project=ci_service_project, github_sha=ci_service_sha ) Avec postGithubState Dans le traitement approprié, ajoutez le traitement postGithubState : use cicd/services/github::|success use cicd/services/github::postGithubState /* … */ treatment someStuff[cicd: CicdDispatchEngine]( // Ajoutez les paramètres suivants github_token: string, github_project: string, github_sha: string ) // … { /* … */ postSuccess: postGithubState( name="Doing a treatment", description="Treatment accomplishing some stuff", state=|success(), project=github_project, sha=github_sha, token=github_token ) theTreatment.completed -> postSuccess.trigger } Il existe aussi un traitement plus générique setServiceState avec des déclencheurs prêts à l’emploi pour différents états : use cicd/services::setServiceState /* … */ treatment someStuff[cicd: CicdDispatchEngine]( // Ajoutez les paramètres suivants github_token: string, github_project: string, github_sha: string ) // … { /* … */ setServiceState( name="Doing a treatment", description="Treatment accomplishing some stuff", github=true, github_project=github_project, github_sha=github_sha, github_token=github_token ) Self.trigger -----------> setServiceState.pending theTreatment.completed -> setServiceState.success theTreatment.failed ----> setServiceState.failed } Configurer les variables Pour utiliser certaines fonctionnalités, comme l’API Cadence.CI ou l’API GitHub pour les rapports, des variables et des secrets doivent être configurés. Dans GitHub, dans Settings > Secrets and variables > Action, dans la section Repository Secrets, ajoutez les tokens correspondants pour les rendre disponibles dans les workflows.Outil de Migration AutomatiséGénérer avec l'IA