]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Improve 加快构建
authorqydysky <qydysky@foxmail.com>
Sun, 21 May 2023 07:28:59 +0000 (15:28 +0800)
committerqydysky <qydysky@foxmail.com>
Sun, 21 May 2023 07:28:59 +0000 (15:28 +0800)
.github/workflows/go.yml
.github/workflows/test.yml

index d6287f7f98f9dfeecfa07f5e2320d69ca19de295..41bc95a765739d70475c32f3afc4b91dc1ac734b 100644 (file)
@@ -8,8 +8,8 @@ on:
     - 'VERSION'
 
 jobs:
-  u-build:
-    name: build_ubuntu_go${{ matrix.go }}
+  buildtest:
+    name: test_ubuntu_go${{ matrix.go }}
     runs-on: ubuntu-latest
     strategy:
       matrix:
@@ -27,7 +27,7 @@ jobs:
       uses: golangci/golangci-lint-action@v3
       with:
         args: --timeout 5m --verbose
-        
+
     - name: Test
       run: |
         sudo apt-get update
@@ -40,6 +40,22 @@ jobs:
       with:
         token: ${{secrets.CODECOV_TOKEN}}
         file: coverage
+
+  u-build:
+    name: build_ubuntu_go${{ matrix.go }}
+    needs: [buildtest]
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        go: [ '1.20' ]
+    steps:
+    - name: Set up Go${{ matrix.go }}
+      uses: actions/setup-go@v3
+      with:
+        go-version: ${{ matrix.go }}
+
+    - name: Check out code
+      uses: actions/checkout@v3
       
     - name: Build
       run: |
@@ -61,6 +77,7 @@ jobs:
 
   w-build:
     name: build_windows_go${{ matrix.go }}
+    needs: [buildtest]
     runs-on: windows-latest
     strategy:
       matrix:
@@ -74,23 +91,6 @@ jobs:
     - name: Check out code
       uses: actions/checkout@v3
 
-    - name: golangci-lint
-      uses: golangci/golangci-lint-action@v3
-      with:
-        args: --timeout 5m --verbose
-
-    - name: Test
-      run: |
-        set CGO_ENABLED=0
-        go get .
-        go test -v --cover -coverprofile=coverage ./...
-        
-    - name: Codecov
-      uses: codecov/codecov-action@v3
-      with:
-        token: ${{secrets.CODECOV_TOKEN}}
-        file: coverage
-      
     - name: Build
       run: |
         cd demo
index 4c60a8623f3ff0214bf9a075f56f5090b030881b..c7a6258d147195b9df48e0985b81d3e0d63edafb 100644 (file)
@@ -11,8 +11,8 @@ on:
       - '**.sum'
 
 jobs:
-  u-build:
-    name: build_ubuntu_go${{ matrix.go }}
+  buildtest:
+    name: test_ubuntu_go${{ matrix.go }}
     runs-on: ubuntu-latest
     strategy:
       matrix:
@@ -43,7 +43,23 @@ jobs:
       with:
         token: ${{secrets.CODECOV_TOKEN}}
         file: coverage
-      
+
+  u-build:
+    name: build_ubuntu_go${{ matrix.go }}
+    needs: [buildtest]
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        go: [ '1.20' ]
+    steps:
+    - name: Set up Go${{ matrix.go }}
+      uses: actions/setup-go@v3
+      with:
+        go-version: ${{ matrix.go }}
+
+    - name: Check out code
+      uses: actions/checkout@v3
+
     - name: Build
       run: |
         cd demo
@@ -62,6 +78,7 @@ jobs:
         
   w-build:
     name: build_windows_go${{ matrix.go }}
+    needs: [buildtest]
     runs-on: windows-latest
     strategy:
       matrix:
@@ -75,23 +92,6 @@ jobs:
     - name: Check out code
       uses: actions/checkout@v3
 
-    - name: golangci-lint
-      uses: golangci/golangci-lint-action@v3
-      with:
-        args: --timeout 5m --verbose
-
-    - name: Test
-      run: |
-        set CGO_ENABLED=0
-        go get .
-        go test -v --cover -coverprofile=coverage ./...
-
-    - name: Codecov
-      uses: codecov/codecov-action@v3
-      with:
-        token: ${{secrets.CODECOV_TOKEN}}
-        file: coverage
-        
     - name: Build
       run: |
         cd demo