Browse Source

增加concurrency配置

lqg 2 years ago
parent
commit
2511f98353
1 changed files with 17 additions and 0 deletions
  1. 17 0
      .github/workflows/test.yml

+ 17 - 0
.github/workflows/test.yml

@@ -1,5 +1,10 @@
 name: Github-Action-Test
 
+# 一次只运行一个job
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
 on:
   push:
     branches: [master]
@@ -11,16 +16,28 @@ on:
   pull_request:
   # 新建一个PR时
     types: [create, synchronize, update]
+    # 
     branches: [feature/**]
+    # 
+    paths:
+      - ".github/workflows/test.yaml"
+      - "src/api"
 on:
   schedule:
   # 每天凌晨 8:30 执行
     cron: "30 8 * * *"
 
 jobs:
+  # 构建名称
   build:
     runs-on: ubuntu-latest
 
+    with:
+      working_directory: flutter_news_example/api
+      analyze_directories: "routes lib test"
+      coverage_excludes: "**/*.g.dart"
+      report_on: "routes,lib"
+
     steps:
       - uses: actions/checkout@v2