{"id":326563,"date":"2021-07-16T15:01:13","date_gmt":"2021-07-16T15:01:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=326563"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=326563","title":{"rendered":"\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f: \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 GitHub Action \u043d\u0430 Dart"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0414\u043c\u0438\u0442\u0440\u0438\u0439 \u041a\u0440\u0443\u0446\u043a\u0438\u0445, \u044f Flutter-\u0442\u0438\u043c\u043b\u0438\u0434 <a href=\"https:\/\/surf.ru\"><u>\u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Surf<\/u><\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 <a href=\"https:\/\/github.com\/features\/actions\"><u>GitHub Action<\/u><\/a><u>,<\/u> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Dart.&nbsp;<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/13c\/c5a\/523\/13cc5a523ca7ccc0d5c3ba27d6b27bef.jpg\" width=\"780\" height=\"440\"><figcaption><\/figcaption><\/figure>\n<p>GitHub Actions \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u0438\u043b\u0438 CI\/CD.&nbsp; \u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 CI\/CD \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c \u0440\u044f\u0434 \u0431\u0435\u043d\u0435\u0444\u0438\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u043f\u043b\u0435\u0447\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0432\u043d\u043e\u0441\u0438\u043c\u044b\u0445 \u0432 \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443,<\/p>\n<\/li>\n<li>\n<p>\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0441\u0442\u0438\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0443\u0441\u043a \u0432\u0441\u0435\u0445 \u0432\u0438\u0434\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0435\u043c, \u043a\u0442\u043e \u043f\u0438\u0448\u0435\u0442 \u043d\u0430 Dart, \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 GitHub Actions, \u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439: \u0432 <a href=\"https:\/\/github.com\/marketplace?type=actions\"><u>GitHub Marketplace<\/u><\/a> \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438.&nbsp;<\/p>\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Dart \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/features\/actions\"><u>GitHub Actions<\/u><\/a>. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0441 \u044f\u0437\u044b\u043a\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c CI\/CD: \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0432\u0430\u043c Dart \u0438 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0432\u0441\u0451 \u043d\u0430 \u043d\u0451\u043c.<\/p>\n<h3>GitHub Actions: \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0441\u0432\u0435\u0436\u0438\u043c \u0442\u0435\u043e\u0440\u0438\u044e. <\/p>\n<p><strong>Actions<\/strong> \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0441\u0430\u043c\u044b\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438.&nbsp; Actions \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u0440\u0435\u0445 \u0432\u0438\u0434\u043e\u0432:&nbsp;<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/docs.github.com\/en\/actions\/creating-actions\/creating-a-composite-run-steps-action\"><u>\u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439<\/u><\/a> (\u043f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439),&nbsp;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.github.com\/en\/actions\/creating-actions\/creating-a-javascript-action\"><u>JavaScript action<\/u><\/a>,<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.github.com\/en\/actions\/creating-actions\/creating-a-docker-container-action\"><u>\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435<\/u><\/a>.&nbsp;<\/p>\n<\/li>\n<\/ul>\n<p><strong>Job <\/strong>\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 Actions. \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 jobs \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445.&nbsp; \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.&nbsp;<\/p>\n<p><strong>Workflow (\u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441) <\/strong>\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 job.<\/p>\n<p>\u0412\u0441\u0451 \u044d\u0442\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 yaml-\u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 .github\/workflows \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0444\u0430\u0439\u043b, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"yaml\">name: Dart Code Metrics   on: [push] # \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0435 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439   jobs:  check:    name: dart-code-metrics-action      runs-on: ubuntu-latest      steps:      # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c actions\/checkout      - uses: actions\/checkout@v2            # \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c dart-code-metrics-action \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u043c\u0443 GitHub \u0442\u043e\u043a\u0435\u043d      - name: dart-code-metrics        uses: dart-code-checker\/dart-code-metrics-action@v1        with:          github_token: ${{ secrets.GITHUB_TOKEN }} <\/code><\/pre>\n<p>\u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 Action, \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0448\u0430\u0433\u0430 \u0432 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.&nbsp;<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/h3>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u0434 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 Dart, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u0448\u0435\u0433\u043e action \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:<\/p>\n<pre><code>. \taction_app \t\tbin \t\t\tmain.dart \t\tpubspec.yaml \taction.yaml \tDockerfile \tREADME.md <\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 main.dart. \u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 action \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"dart\">import 'dart:io';   import 'package:github_actions_toolkit\/github_actions_toolkit.dart';   void main(List&lt;String&gt; arguments) async {  try {    \/\/ `name` input defined in `action.yaml` file    final name = Input('name', isRequired: true, canBeEmpty: false);      log.info('Hello ${name.value} \u200b!');  } catch (error) {    log.error(error.toString());    exitCode = 1;  } } <\/code><\/pre>\n<p>\u0422\u043e\u0447\u043a\u043e\u0439 \u0432\u0445\u043e\u0434\u0430, \u043a\u0430\u043a \u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 Dart, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f main. \u0422\u0435\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u0431\u043b\u043e\u043a try-catch, \u0447\u0442\u043e\u0431\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0431\u043e\u0440\u043a\u0430 \u0432 GitHub \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043b\u0430\u0441\u044c (\u0438\u043d\u0430\u0447\u0435 \u043e\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439).<\/p>\n<p>\u041c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u0430\u043a\u0435\u0442\u043e\u043c <strong>github_action_toolkit<\/strong> \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043b\u043e\u0433.<\/p>\n<p>\u0412 \u043a\u043e\u0440\u043d\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c action.yaml<\/p>\n<pre><code class=\"yaml\">name: Hello description: Greet someone   inputs:  name: # id of input    description: Who to greet    required: true    default: \"World\"   runs:  using: \"docker\"  image: \"Dockerfile\" <\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b action.yaml \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435: \u043f\u043e \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u044e GitHub \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u043f\u0430\u043f\u043a\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043a\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0438 \u0434\u0430\u0451\u043c \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430: \u0444\u0430\u0439\u043b Dockerfile.&nbsp;<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 action.yaml \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c, \u0447\u0442\u043e \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0443\u0442 \u0438\u043c\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c \u0444\u0430\u0439\u043b\u0430 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432 <a href=\"https:\/\/docs.github.com\/en\/actions\/creating-actions\/metadata-syntax-for-github-actions\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/u><\/a>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c Dockerfile:<\/p>\n<pre><code>FROM google\/dart:latest   COPY action_app\/ \/action_app\/   RUN cd \/action_app \\    &amp;&amp; pub get \\    &amp;&amp; dart run \/action_app\/bin\/main.dart <\/code><\/pre>\n<p>    \u0424\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u043a\u0435\u0440\u0443. \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u0435\u0440\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043e\u0442 Google \u0441 \u0441\u0430\u043c\u043e\u0439 \u0441\u0432\u0435\u0436\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044f\u0437\u044b\u043a\u0430 Dart. \u0414\u0430\u043b\u0435\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>action_app<\/strong>. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <strong>main.dart<\/strong>.<\/p>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6f3\/0b6\/1c5\/6f30b61c5655cd56e7e1878d5a3e057f.gif\" width=\"640\" height=\"356\"><figcaption><\/figcaption><\/figure>\n<h2>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p><a href=\"https:\/\/docs.github.com\/en\/actions\"><u>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a GitHub Actions<\/u><\/a><\/p>\n<p><a href=\"https:\/\/pub.dev\/packages\/github_actions_toolkit\"><u>Github_actions_toolkit<\/u><\/a> \u2014 Dart-\u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 Inputs \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 Outputs.<\/p>\n<p><a href=\"https:\/\/github.com\/dart-code-checker\/dart-code-metrics-action\"><u>Dart Code Metrics Action<\/u><\/a> \u2014 action \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u0430 Dart.<\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/surfstudio\/blog\/520506\/\"><u>\u00ab\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Github Actions \u0434\u043b\u044f CI\/CD \u043d\u0430 Flutter-\u043f\u0440\u043e\u0435\u043a\u0442\u0435\u00bb<\/u><\/a> \u2014 \u0433\u0430\u0439\u0434 \u043f\u043e GitHub Actions \u043e\u0442 \u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u043f\u043e Surf \u0415\u0432\u0433\u0435\u043d\u0438\u044f \u0421\u0430\u0442\u0443\u0440\u043e\u0432\u0430.<\/p>\n<p><a href=\"https:\/\/github.com\/surfstudio\/SurfGear\"><u>Surf Gear<\/u><\/a> \u2014 \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Surf. \u041b\u0438\u0431\u044b, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b, \u0442\u0443\u043b\u0437\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 Flutter.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/surfstudio\/blog\/568030\/\"> https:\/\/habr.com\/ru\/company\/surfstudio\/blog\/568030\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442! \u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0414\u043c\u0438\u0442\u0440\u0438\u0439 \u041a\u0440\u0443\u0446\u043a\u0438\u0445, \u044f Flutter-\u0442\u0438\u043c\u043b\u0438\u0434 <a href=\"https:\/\/surf.ru\"><u>\u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Surf<\/u><\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 <a href=\"https:\/\/github.com\/features\/actions\"><u>GitHub Action<\/u><\/a><u>,<\/u> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Dart.&nbsp;<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>GitHub Actions \u2014 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u0438\u043b\u0438 CI\/CD.&nbsp; \u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 CI\/CD \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c \u0440\u044f\u0434 \u0431\u0435\u043d\u0435\u0444\u0438\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0430 \u043f\u043b\u0435\u0447\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u043a\u0438:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0432\u043d\u043e\u0441\u0438\u043c\u044b\u0445 \u0432 \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443,<\/p>\n<\/li>\n<li>\n<p>\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0441\u0442\u0438\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430,<\/p>\n<\/li>\n<li>\n<p>\u0437\u0430\u043f\u0443\u0441\u043a \u0432\u0441\u0435\u0445 \u0432\u0438\u0434\u043e\u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0435\u043c, \u043a\u0442\u043e \u043f\u0438\u0448\u0435\u0442 \u043d\u0430 Dart, \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 GitHub Actions, \u043d\u043e \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439: \u0432 <a href=\"https:\/\/github.com\/marketplace?type=actions\"><u>GitHub Marketplace<\/u><\/a> \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438.&nbsp;<\/p>\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 Dart \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f <a href=\"https:\/\/github.com\/features\/actions\"><u>GitHub Actions<\/u><\/a>. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0441 \u044f\u0437\u044b\u043a\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c CI\/CD: \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0432\u0430\u043c Dart \u0438 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0432\u0441\u0451 \u043d\u0430 \u043d\u0451\u043c.<\/p>\n<h3>GitHub Actions: \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0441\u0432\u0435\u0436\u0438\u043c \u0442\u0435\u043e\u0440\u0438\u044e. <\/p>\n<p><strong>Actions<\/strong> \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0441\u0430\u043c\u044b\u0439 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438.&nbsp; Actions \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u0440\u0435\u0445 \u0432\u0438\u0434\u043e\u0432:&nbsp;<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/docs.github.com\/en\/actions\/creating-actions\/creating-a-composite-run-steps-action\"><u>\u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439<\/u><\/a> (\u043f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439),&nbsp;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.github.com\/en\/actions\/creating-actions\/creating-a-javascript-action\"><u>JavaScript action<\/u><\/a>,<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.github.com\/en\/actions\/creating-actions\/creating-a-docker-container-action\"><u>\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435<\/u><\/a>.&nbsp;<\/p>\n<\/li>\n<\/ul>\n<p><strong>Job <\/strong>\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0437 Actions. \u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 jobs \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0438 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445.&nbsp; \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.&nbsp;<\/p>\n<p><strong>Workflow (\u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441) <\/strong>\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 job.<\/p>\n<p>\u0412\u0441\u0451 \u044d\u0442\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 yaml-\u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 .github\/workflows \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0444\u0430\u0439\u043b, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code class=\"yaml\">name: Dart Code Metrics   on: [push] # \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0435 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439   jobs:  check:    name: dart-code-metrics-action      runs-on: ubuntu-latest      steps:      # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c actions\/checkout      - uses: actions\/checkout@v2            # \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c dart-code-metrics-action \u043f\u0435\u0440\u0435\u0434\u0430\u0432 \u0435\u043c\u0443 GitHub \u0442\u043e\u043a\u0435\u043d      - name: dart-code-metrics        uses: dart-code-checker\/dart-code-metrics-action@v1        with:          github_token: ${{ secrets.GITHUB_TOKEN }} <\/code><\/pre>\n<p>\u041d\u0430\u0448\u0430 \u0446\u0435\u043b\u044c \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 Action, \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0448\u0430\u0433\u0430 \u0432 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.&nbsp;<\/p>\n<h3>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f<\/h3>\n<p>\u041c\u044b \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043d\u0430\u0448 \u043a\u043e\u0434 \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 Dart, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c.<\/p>\n<p>\u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u0448\u0435\u0433\u043e action \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:<\/p>\n<pre><code>. \taction_app \t\tbin \t\t\tmain.dart \t\tpubspec.yaml \taction.yaml \tDockerfile \tREADME.md <\/code><\/pre>\n<p>\u041a\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 main.dart. \u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 action \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"dart\">import 'dart:io';   import 'package:github_actions_toolkit\/github_actions_toolkit.dart';   void main(List&lt;String&gt; arguments) async {  try {    \/\/ `name` input defined in `action.yaml` file    final name = Input('name', isRequired: true, canBeEmpty: false);      log.info('Hello ${name.value} \u200b!');  } catch (error) {    log.error(error.toString());    exitCode = 1;  } } <\/code><\/pre>\n<p>\u0422\u043e\u0447\u043a\u043e\u0439 \u0432\u0445\u043e\u0434\u0430, \u043a\u0430\u043a \u0438 \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 Dart, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f main. \u0422\u0435\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0432 \u0431\u043b\u043e\u043a try-catch, \u0447\u0442\u043e\u0431\u044b \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0431\u043e\u0440\u043a\u0430 \u0432 GitHub \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043b\u0430\u0441\u044c (\u0438\u043d\u0430\u0447\u0435 \u043e\u043d\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439).<\/p>\n<p>\u041c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u0430\u043a\u0435\u0442\u043e\u043c <strong>github_action_toolkit<\/strong> \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0438 \u0432\u044b\u0432\u043e\u0434\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0432 \u043b\u043e\u0433.<\/p>\n<p>\u0412 \u043a\u043e\u0440\u043d\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c action.yaml<\/p>\n<pre><code class=\"yaml\">name: Hello description: Greet someone   inputs:  name: # id of input    description: Who to greet    required: true    default: \"World\"   runs:  using: \"docker\"  image: \"Dockerfile\" <\/code><\/pre>\n<p>\u0424\u0430\u0439\u043b action.yaml \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435: \u043f\u043e \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u044e GitHub \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u043f\u0430\u043f\u043a\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u043a\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0438 \u0434\u0430\u0451\u043c \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430: \u0444\u0430\u0439\u043b Dockerfile.&nbsp;<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 action.yaml \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c, \u0447\u0442\u043e \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0443\u0442 \u0438\u043c\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c \u0444\u0430\u0439\u043b\u0430 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0432 <a href=\"https:\/\/docs.github.com\/en\/actions\/creating-actions\/metadata-syntax-for-github-actions\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/u><\/a>.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c Dockerfile:<\/p>\n<pre><code>FROM google\/dart:latest   COPY action_app\/ \/action_app\/   RUN cd \/action_app \\    &amp;&amp; pub get \\    &amp;&amp; dart run \/action_app\/bin\/main.dart <\/code><\/pre>\n<p>    \u0424\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043e\u043a\u0435\u0440\u0443. \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u0435\u0440\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u043e\u0442 Google \u0441 \u0441\u0430\u043c\u043e\u0439 \u0441\u0432\u0435\u0436\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u044f\u0437\u044b\u043a\u0430 Dart. \u0414\u0430\u043b\u0435\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 \u043f\u0430\u043f\u043a\u0435 <strong>action_app<\/strong>. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u043e\u0447\u043a\u0430 \u0432\u0445\u043e\u0434\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 <strong>main.dart<\/strong>.<\/p>\n<h3>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430<\/h3>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h2>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p><a href=\"https:\/\/docs.github.com\/en\/actions\"><u>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a GitHub Actions<\/u><\/a><\/p>\n<p><a href=\"https:\/\/pub.dev\/packages\/github_actions_toolkit\"><u>Github_actions_toolkit<\/u><\/a> \u2014 Dart-\u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 Inputs \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 Outputs.<\/p>\n<p><a href=\"https:\/\/github.com\/dart-code-checker\/dart-code-metrics-action\"><u>Dart Code Metrics Action<\/u><\/a> \u2014 action \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0434\u043b\u044f \u044f\u0437\u044b\u043a\u0430 Dart.<\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/surfstudio\/blog\/520506\/\"><u>\u00ab\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 Github Actions \u0434\u043b\u044f CI\/CD \u043d\u0430 Flutter-\u043f\u0440\u043e\u0435\u043a\u0442\u0435\u00bb<\/u><\/a> \u2014 \u0433\u0430\u0439\u0434 \u043f\u043e GitHub Actions \u043e\u0442 \u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u0433\u0438 \u043f\u043e Surf \u0415\u0432\u0433\u0435\u043d\u0438\u044f \u0421\u0430\u0442\u0443\u0440\u043e\u0432\u0430.<\/p>\n<p><a href=\"https:\/\/github.com\/surfstudio\/SurfGear\"><u>Surf Gear<\/u><\/a> \u2014 \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441\u043d\u044b\u0439 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 Surf. \u041b\u0438\u0431\u044b, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b, \u0442\u0443\u043b\u0437\u044b \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 Flutter.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/surfstudio\/blog\/568030\/\"> https:\/\/habr.com\/ru\/company\/surfstudio\/blog\/568030\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-326563","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=326563"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326563\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}