{"id":7732,"date":"2025-09-02T09:20:42","date_gmt":"2025-09-02T09:20:42","guid":{"rendered":"https:\/\/techhub.saworks.io\/?post_type=docs&#038;p=7732"},"modified":"2025-09-24T12:02:34","modified_gmt":"2025-09-24T12:02:34","slug":"analyser-un-fichier-de-workflow","status":"publish","type":"docs","link":"https:\/\/techhub.saworks.io\/fr\/docs\/tutoriel-github-intermediaire\/automatiser-les-tests-de-charge-azure-en-utilisant-github\/analyser-un-fichier-de-workflow\/","title":{"rendered":"Analyser un fichier de workflow"},"content":{"rendered":"\n<div class=\"wp-block-group is-layout-constrained wp-block-group-is-layout-constrained\">\n<p><strong>GitHub Actions utilise la syntaxe YAML pour d\u00e9finir le flux de travail. Chaque flux de travail est enregistr\u00e9 sous forme de fichier YAML distinct dans le d\u00e9p\u00f4t de code, dans un r\u00e9pertoire nomm\u00e9 <code>.github\/workflows<\/code>.<\/strong><\/p>\n\n\n\n<p>L\u2019exemple de flux de travail suivant est d\u00e9clench\u00e9 chaque fois qu\u2019un code est pouss\u00e9 dans un d\u00e9p\u00f4t. Le flux de travail ex\u00e9cute les \u00e9tapes suivantes :<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>R\u00e9cup\u00e8re le code pouss\u00e9.<\/strong><\/li>\n\n\n\n<li><strong>Installe Node.js.<\/strong><\/li>\n\n\n\n<li><strong>Installe le framework de test Bash Automated Testing System (Bats).<\/strong><\/li>\n\n\n\n<li><strong>Ex\u00e9cute une commande pour afficher la version de Bats : <code>bats -v<\/code>.<\/strong><\/li>\n<\/ol>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(2 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#f2f2f2;color:#2f363c\">YAML<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>name: learn-github-actions\nrun-name: ${{ github.actor }} is learning GitHub Actions\non: &#91;push&#93;\njobs:\n  check-bats-version:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\/checkout@v4\n      - uses: actions\/setup-node@v4\n        with:\n          node-version: '20'\n      - run: npm install -g bats\n      - run: bats -v<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #22863A\">name<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">learn-github-actions<\/span><\/span>\n<span class=\"line\"><span style=\"color: #22863A\">run-name<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">${{ github.actor }} is learning GitHub Actions<\/span><\/span>\n<span class=\"line\"><span style=\"color: #005CC5\">on<\/span><span style=\"color: #24292E\">: &#91;<\/span><span style=\"color: #032F62\">push<\/span><span style=\"color: #24292E\">&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #22863A\">jobs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">check-bats-version<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">runs-on<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">ubuntu-latest<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">steps<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">      - <\/span><span style=\"color: #22863A\">uses<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">actions\/checkout@v4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">      - <\/span><span style=\"color: #22863A\">uses<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">actions\/setup-node@v4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        <\/span><span style=\"color: #22863A\">with<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">          <\/span><span style=\"color: #22863A\">node-version<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;20&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">      - <\/span><span style=\"color: #22863A\">run<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">npm install -g bats<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">      - <\/span><span style=\"color: #22863A\">run<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">bats -v<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Comprendre le fichier de flux de travail<\/strong><br>Pour vous aider \u00e0 comprendre comment la syntaxe YAML est utilis\u00e9e pour cr\u00e9er un fichier de flux de travail, cette section explique chaque ligne de l\u2019exemple pr\u00e9c\u00e9dent :<\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.75rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#24292e;--cbp-line-number-width:calc(2 * 0.6 * .75rem);line-height:1rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:flex;align-items:center;padding:10px 0px 10px 16px;margin-bottom:-2px;width:100%;text-align:left;background-color:#f2f2f2;color:#2f363c\">YAML<\/span><span role=\"button\" tabindex=\"0\" style=\"color:#24292e;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly># Optional - The name of the workflow as it will appear in the \"Actions\" tab of the GitHub repository. If this field is omitted, the name of the workflow file will be used instead.\nname: learn-github-actions\n\n# Optional - The name for workflow runs generated that appear in the list of workflow runs on your repository's \"Actions\" tab. This example uses an expression with the 'github' context to display the username of the actor that triggered the workflow run. \nrun-name: ${{ github.actor }} is learning GitHub Actions\n\n# Specifies the trigger for this workflow. This example uses the 'push' event, so a workflow run is triggered every time someone pushes a change to the repository or merges a pull request.\non: &#91;push&#93;\n\n# Groups together all the jobs that run in the 'learn-github-actions' workflow.\njobs:\n\n# Defines a job named 'check-bats-version'. The child keys will define properties of the job.\n  check-bats-version:\n\n# Configures the job to run on the latest version of an Ubuntu Linux runner. This means that the job will execute on a fresh virtual machine hosted by GitHub.\n    runs-on: ubuntu-latest\n\n# Groups together all the steps that run in the 'check-bats-version' job. Each item nested under this section is a separate action or shell script.\n    steps:\n\n# The 'uses' keyword specifies that this step will run 'v4' of the 'actions\/checkout' action. This is an action that checks out your repository onto the runner, allowing you to run scripts or other actions against your code (such as build and test tools). You should use the checkout action any time your workflow will use the repository's code.\n      - uses: actions\/checkout@v4\n\n# This step uses the 'actions\/setup-node@v4' action to install the specified version of the Node.js. (This example uses version 20.) This puts both the 'node' and 'npm' commands in your PATH.\n      - uses: actions\/setup-node@v4\n        with:\n          node-version: '20'\n\n# The 'run' keyword tells the job to execute a command on the runner. In this case, you are using 'npm' to install the 'bats' software testing package.\n      - run: npm install -g bats\n\n# The 'bats' command with a parameter that outputs the software version.\n      - run: bats -v<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-light\" style=\"background-color: #fff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #6A737D\"># Optional - The name of the workflow as it will appear in the &quot;Actions&quot; tab of the GitHub repository. If this field is omitted, the name of the workflow file will be used instead.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #22863A\">name<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">learn-github-actions<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Optional - The name for workflow runs generated that appear in the list of workflow runs on your repository&#39;s &quot;Actions&quot; tab. This example uses an expression with the &#39;github&#39; context to display the username of the actor that triggered the workflow run. <\/span><\/span>\n<span class=\"line\"><span style=\"color: #22863A\">run-name<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">${{ github.actor }} is learning GitHub Actions<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Specifies the trigger for this workflow. This example uses the &#39;push&#39; event, so a workflow run is triggered every time someone pushes a change to the repository or merges a pull request.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #005CC5\">on<\/span><span style=\"color: #24292E\">: &#91;<\/span><span style=\"color: #032F62\">push<\/span><span style=\"color: #24292E\">&#93;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Groups together all the jobs that run in the &#39;learn-github-actions&#39; workflow.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #22863A\">jobs<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Defines a job named &#39;check-bats-version&#39;. The child keys will define properties of the job.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">  <\/span><span style=\"color: #22863A\">check-bats-version<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Configures the job to run on the latest version of an Ubuntu Linux runner. This means that the job will execute on a fresh virtual machine hosted by GitHub.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">runs-on<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">ubuntu-latest<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># Groups together all the steps that run in the &#39;check-bats-version&#39; job. Each item nested under this section is a separate action or shell script.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">    <\/span><span style=\"color: #22863A\">steps<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># The &#39;uses&#39; keyword specifies that this step will run &#39;v4&#39; of the &#39;actions\/checkout&#39; action. This is an action that checks out your repository onto the runner, allowing you to run scripts or other actions against your code (such as build and test tools). You should use the checkout action any time your workflow will use the repository&#39;s code.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">      - <\/span><span style=\"color: #22863A\">uses<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">actions\/checkout@v4<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># This step uses the &#39;actions\/setup-node@v4&#39; action to install the specified version of the Node.js. (This example uses version 20.) This puts both the &#39;node&#39; and &#39;npm&#39; commands in your PATH.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">      - <\/span><span style=\"color: #22863A\">uses<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">actions\/setup-node@v4<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">        <\/span><span style=\"color: #22863A\">with<\/span><span style=\"color: #24292E\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">          <\/span><span style=\"color: #22863A\">node-version<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">&#39;20&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># The &#39;run&#39; keyword tells the job to execute a command on the runner. In this case, you are using &#39;npm&#39; to install the &#39;bats&#39; software testing package.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">      - <\/span><span style=\"color: #22863A\">run<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">npm install -g bats<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #6A737D\"># The &#39;bats&#39; command with a parameter that outputs the software version.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #24292E\">      - <\/span><span style=\"color: #22863A\">run<\/span><span style=\"color: #24292E\">: <\/span><span style=\"color: #032F62\">bats -v<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p><strong>Afficher l\u2019activit\u00e9 d\u2019une ex\u00e9cution de flux de travail<\/strong><br>Lorsqu\u2019un flux de travail est d\u00e9clench\u00e9, une ex\u00e9cution de flux de travail est cr\u00e9\u00e9e pour ex\u00e9cuter ce flux. Une fois l\u2019ex\u00e9cution d\u00e9marr\u00e9e, vous pouvez voir un graphique de visualisation de la progression ainsi que l\u2019activit\u00e9 de chaque \u00e9tape sur GitHub. Suivez les \u00e9tapes ci-dessous pour afficher l\u2019activit\u00e9 :<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Acc\u00e9dez \u00e0 la page principale du d\u00e9p\u00f4t.<\/strong><\/li>\n\n\n\n<li><strong>S\u00e9lectionnez l\u2019onglet <em>Actions<\/em> situ\u00e9 sous le nom du d\u00e9p\u00f4t.<\/strong><\/li>\n<\/ol>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"653\" height=\"102\" data-src=\"https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/github-nav-actions.png\" alt=\"\" class=\"wp-image-7734 lazyload\" data-srcset=\"https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/github-nav-actions.png 653w, https:\/\/techhub.saworks.io\/wp-content\/uploads\/2025\/08\/github-nav-actions-300x47.png 300w\" data-sizes=\"(max-width: 653px) 100vw, 653px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 653px; --smush-placeholder-aspect-ratio: 653\/102;\" \/><\/figure>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>3. <strong>Dans la barre lat\u00e9rale gauche, s\u00e9lectionnez le flux de travail que vous souhaitez consulter.<\/strong><\/p>\n\n\n\n<p>4. <strong>Dans la liste des ex\u00e9cutions de flux de travail, s\u00e9lectionnez le nom de l\u2019ex\u00e9cution pour voir le r\u00e9sum\u00e9 de l\u2019ex\u00e9cution.<\/strong><\/p>\n\n\n\n<p>5. <strong>Dans la barre lat\u00e9rale gauche ou dans le graphique de visualisation, s\u00e9lectionnez le job que vous souhaitez consulter.<\/strong><\/p>\n\n\n\n<p>6. <strong>S\u00e9lectionnez une \u00e9tape pour afficher les r\u00e9sultats d\u00e9taill\u00e9s.<\/strong><\/p>\n\n\n\n<p>Maintenant que vous comprenez les composants du fichier de flux de travail, vous pouvez voir comment les d\u00e9veloppeurs peuvent personnaliser ce fichier pour une vari\u00e9t\u00e9 de cas d\u2019usage.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>GitHub Actions utilise la syntaxe YAML pour d\u00e9finir le flux de travail. Chaque flux de travail est enregistr\u00e9 sous forme de fichier YAML [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":7721,"menu_order":44,"template":"","doc_tag":[],"doc_badge":[],"class_list":["post-7732","docs","type-docs","status-publish","hentry"],"author_avatar":"https:\/\/secure.gravatar.com\/avatar\/6a70e7c73db9f245e650948d09d74f61?s=96&d=mm&r=g","author_name":"Annick N'dri","_links":{"self":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/7732"}],"collection":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":0,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/7732\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/docs\/7721"}],"wp:attachment":[{"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/media?parent=7732"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/doc_tag?post=7732"},{"taxonomy":"doc_badge","embeddable":true,"href":"https:\/\/techhub.saworks.io\/fr\/wp-json\/wp\/v2\/doc_badge?post=7732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}