starsz commented on a change in pull request #2072:
URL: https://github.com/apache/apisix-dashboard/pull/2072#discussion_r690833475



##########
File path: .github/workflows/auto-build-rpm.yml
##########
@@ -29,6 +29,19 @@ jobs:
       - name: Check out code
         uses: actions/checkout@v2
 
+      - uses: docker/setup-buildx-action@v1
+        with:
+          install: true
+
+      - run: docker login

Review comment:
       It seems that we don't provide the username and password when docker 
login?

##########
File path: .github/workflows/go-lint.yml
##########
@@ -3,37 +3,72 @@ on:
   push:
     branches:
       - master
-    paths-ignore:
-      - 'docs/**'
-      - 'web/**'
+    paths:
+      - 'api/**'
   pull_request:
     branches:
       - master
-    paths-ignore:
-      - 'docs/**'
-      - 'web/**'
+    paths:
+      - 'api/**'
 
 jobs:
+  go-filter:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodule: true
+
+      - uses: ./.github/actions/paths-filter
+        id: changes
+        with:
+          filters: |
+            go:
+              - '**.go'
+          working-directory: 'api'
+          list-files: shell
+    outputs:
+      matches: ${{ steps.changes.outputs.go }}
+      files: ${{ steps.changes.outputs.go_files }}
+
   golangci:
     runs-on: ubuntu-latest
+    needs: go-filter
+    if: needs.go-filter.outputs.matches == 'true'
     steps:
       - uses: actions/checkout@v2
 
-      - name: run lint
-        run: make go-lint
+      - name: golangci-lint
+        uses: golangci/golangci-lint-action@v2
+        with:
+          version: latest
+          working-directory: api
+          args: --tests=false
+          only-new-issues: true
 
   gofmt:
     runs-on: ubuntu-latest
+    needs: go-filter
+    if: needs.go-filter.outputs.matches == 'true'
     steps:
       - uses: actions/checkout@v2
       - name: setup go
         uses: actions/setup-go@v1
         with:
           go-version: '1.13'
+
+      - uses: actions/cache@v2
+        with:
+          path: |
+            ~/.cache/go-build
+            ~/go/pkg/mod
+          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
+          restore-keys: |
+            ${{ runner.os }}-go-

Review comment:
       Just want to know what's the use of this stage?

##########
File path: .github/workflows/go-lint.yml
##########
@@ -3,37 +3,72 @@ on:
   push:
     branches:
       - master
-    paths-ignore:
-      - 'docs/**'
-      - 'web/**'
+    paths:
+      - 'api/**'
   pull_request:
     branches:
       - master
-    paths-ignore:
-      - 'docs/**'
-      - 'web/**'
+    paths:
+      - 'api/**'
 
 jobs:
+  go-filter:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          submodule: true
+
+      - uses: ./.github/actions/paths-filter
+        id: changes
+        with:
+          filters: |
+            go:
+              - '**.go'
+          working-directory: 'api'
+          list-files: shell
+    outputs:
+      matches: ${{ steps.changes.outputs.go }}
+      files: ${{ steps.changes.outputs.go_files }}
+
   golangci:
     runs-on: ubuntu-latest
+    needs: go-filter
+    if: needs.go-filter.outputs.matches == 'true'
     steps:
       - uses: actions/checkout@v2
 
-      - name: run lint
-        run: make go-lint
+      - name: golangci-lint
+        uses: golangci/golangci-lint-action@v2
+        with:
+          version: latest
+          working-directory: api
+          args: --tests=false
+          only-new-issues: true
 
   gofmt:
     runs-on: ubuntu-latest
+    needs: go-filter
+    if: needs.go-filter.outputs.matches == 'true'
     steps:
       - uses: actions/checkout@v2
       - name: setup go
         uses: actions/setup-go@v1
         with:
           go-version: '1.13'
+
+      - uses: actions/cache@v2
+        with:
+          path: |
+            ~/.cache/go-build
+            ~/go/pkg/mod
+          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
+          restore-keys: |
+            ${{ runner.os }}-go-

Review comment:
       Pretty good !




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to