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



##########
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:
       This stage caches go mod and build to speed up go, see 
https://github.com/actions/cache/blob/main/examples.md#go---modules

##########
File path: .github/workflows/release-test.yml
##########
@@ -5,12 +5,32 @@ on:
     branches:
       - master
     paths-ignore:
+      - '.github/**'
+      - '.git/**'
+      - '.gitattributes'
+      - '.idea/**'
+      - '.vscode/**'
+      - '.gitignore'
+      - '.DS_Store'
       - 'docs/**'
+      - 'release/**'

Review comment:
       You're right. I just copy the exclude paths in makefile 
https://github.com/apache/apisix-dashboard/blob/28bca96908dabe4af48b06da8f2aeedbbafbe37c/Makefile#L113-L123

##########
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:
       there exist credentials in the actions environment, see this step's 
result in 
https://github.com/apache/apisix-dashboard/pull/2072/checks?check_run_id=3354174287.
   I add this step to solve requests denied to access docker images, but it 
doesn't work. Maybe this PR has no authority to access private docker images?

##########
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:
       @nic-chen Ok, I've removed it. But why docker request is denied?




-- 
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