Browse Source

设置缓存

liuyuqi-dellpc 4 years ago
parent
commit
66cccdbef8

+ 50 - 0
R/build.yml

@@ -0,0 +1,50 @@
+name: auto CI
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+  schedule:
+  - cron: "0 2 * * 1-5"
+
+jobs:
+  build:
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macos-latest, windows-latest]
+        include:
+        - os: ubuntu-latest
+          path: ~/.cache/pip
+        - os: macos-latest
+          path: ~/Library/Caches/pip
+        - os: windows-latest
+          path: ~\AppData\Local\pip\Cache
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v2
+      
+      - uses: actions/cache@v2
+        if: startsWith(runner.os, 'Linux')
+        with:
+          path: ~/.local/share/renv
+          key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-renv-
+
+      - uses: actions/cache@v2
+        if: startsWith(runner.os, 'macOS')
+        with:
+          path: ~/Library/Application Support/renv
+          key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-renv-
+
+      - uses: actions/cache@v2
+        if: startsWith(runner.os, 'Windows')
+        with:
+          path: ~\AppData\Local\renv
+          key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-renv-

+ 8 - 8
android-eclipse/.github/workflows/main.yml

@@ -13,11 +13,11 @@ jobs:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
 
 
     steps:
     steps:
-    - uses: actions/checkout@v2
-    - name: set up JDK 1.8
-      uses: actions/setup-java@v2
-      with:
-        java-version: 1.8
-        distribution: 'adopt'
-    - name: Build Debug APK
-      run:
+      - uses: actions/checkout@v2
+      - name: set up JDK 1.8
+        uses: actions/setup-java@v2
+        with:
+          java-version: 1.8
+          distribution: 'adopt'
+  #     - name: Build Debug APK
+  #       run:

+ 7 - 0
dotnet/.github/workflows/main.yml

@@ -18,6 +18,13 @@ jobs:
           with:
           with:
             dotnet-version: 3.1.100
             dotnet-version: 3.1.100
 
 
+        - uses: actions/cache@v2
+          with:
+            path: ~/.nuget/packages
+            key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
+            restore-keys: |
+              ${{ runner.os }}-nuget-
+
         - name: Pack
         - name: Pack
           run: dotnet pack TestLib --configuration Release -o finalpackage --no-build
           run: dotnet pack TestLib --configuration Release -o finalpackage --no-build
 
 

+ 76 - 18
flutter/.github/workflows/main.yml

@@ -1,12 +1,15 @@
 name: CI
 name: CI
 on:
 on:
   push:
   push:
-    branches: [ master ]
+    branches: [ master , main]
   pull_request:
   pull_request:
-    branches: [ master ]
+    branches: [ master , main]
 jobs:
 jobs:
   build:
   build:
-    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macos-latest]
+    runs-on: ${{matrix.os}}
     steps:
     steps:
       - uses: actions/checkout@v2
       - uses: actions/checkout@v2
 
 
@@ -15,36 +18,91 @@ jobs:
         with:
         with:
           distribution: 'adopt'
           distribution: 'adopt'
           java-version: "8.x"
           java-version: "8.x"
-      
+
+      # - name: Setup gradle
+      #   uses: eskatos/gradle-command-action@v1
+      #   with:
+      #     gradle-version: 6.5
+
       - name: Flutter action
       - name: Flutter action
-        uses: subosito/flutter-action@v1.5.0
+        uses: subosito/flutter-action@v1.5.3
         with:
         with:
           channel: "stable"
           channel: "stable"
-          flutter-version: "2.0.2"
+          flutter-version: "2.0.5"
       
       
       - name: Cache Dependencies
       - name: Cache Dependencies
         id: cache
         id: cache
-        uses: actions/cache@v1
+        uses: actions/cache@v2
         with:
         with:
-          path: node_modules
-          key: ${{runner.OS}}-npm-caches-${{ hashFiles('pubspec.lock') }}
+          path: |
+            ~/.gradle/caches
+            ~/.gradle/wrapper
+            Pods
+          key: |
+            ${{runner.OS}}-gradle-caches-${{ hashFiles('pubspec.lock') }}
+            ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-pods-
+            ${{ runner.os }}-gradle-
 
 
       - name: Install Dependencies
       - name: Install Dependencies
         if: steps.cache.outputs.cache-hit != 'true'
         if: steps.cache.outputs.cache-hit != 'true'
         run: flutter pub get
         run: flutter pub get
 
 
-      - run: flutter build apk --release
+      - name: Build apk
+        if: ${{ runner.os == 'Linux' }}
+        run: flutter build apk --debug --split-per-abi
+
+      - name: Build ios
+        if: ${{ runner.os == 'macOS' }}
+        run: |
+          sudo xcode-select -s /Applications/Xcode_12.3.app
+          flutter build ios --release --no-codesign
+          cd build/ios/iphoneos
+          mkdir Payload
+          cd Payload
+          ln -s ../Runner.app
+          cd ..
+          zip -r app.ipa Payload
+            
+      # - name: Build Web
+      #   run: |
+      #     flutter build web
+      #     cd build/web
+      #     zip -r web-app.zip .
 
 
       # output some file:
       # output some file:
       - name: artifact
       - name: artifact
-        uses: actions/upload-artifact@v1
+        uses: actions/upload-artifact@v2
         with:
         with:
-          name: chat-app-ui
-          path: build/app/outputs
+          name: ${{runner.OS}}-artifact
+          path: |
+            build/app/outputs/flutter-apk/**/*.apk
+            build/ios/**/*.ipa
+
+        
+      # - name: Deploy iOS Beta to TestFlight via Fastlane
+      #     uses: maierj/fastlane-action@v2.0.1
+      #     with:
+      #       lane: beta
+      #       subdirectory: ios
+      #     env:
+      #       APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}'
+      #       DEVELOPER_APP_ID: '${{ secrets.DEVELOPER_APP_ID }}'
+      #       DEVELOPER_APP_IDENTIFIER: '${{ secrets.DEVELOPER_APP_IDENTIFIER }}'
+      #       DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}'
+      #       FASTLANE_APPLE_ID: '${{ secrets.FASTLANE_APPLE_ID }}'
+      #       FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}'
+      #       MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}'
+      #       GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}'
+      #       PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.PROVISIONING_PROFILE_SPECIFIER }}'
+      #       TEMP_KEYCHAIN_PASSWORD: '${{ secrets.TEMP_KEYCHAIN_PASSWORD }}'
+      #       TEMP_KEYCHAIN_USER: '${{ secrets.TEMP_KEYCHAIN_USER }}'
       
       
-      # #  Release
-      # - name: Release apk
-      #   uses: ncipollo/release-action@v1.5.0
+      # - name: Release Apps
+      #   uses: ncipollo/release-action@v1
       #   with:
       #   with:
-      #     artifacts: "build/app/outputs/apk/release/*.apk"
-      #     token: ${{ secrets.GITHUB_RElEASE_TOKEN }}
+      #     tag: ${{ env.APP_VERSION }}
+      #     name: ${{ env.APP_VERSION }}
+      #     token: ${{ secrets.GITHUB_TOKEN }}
+      #     artifacts: 'build/app/outputs/apk/release/*.apk,build/ios/iphoneos/app.ipa,build/web/web-app.zip'

+ 60 - 48
go/.github/workflows/main.yml

@@ -5,59 +5,71 @@ on:
     branches: [ master ]
     branches: [ master ]
   pull_request:
   pull_request:
     branches: [ master ]
     branches: [ master ]
-  # 如果 go 项目在 server 子目录
-  paths: 
-    - './server/**'
 
 
 jobs:
 jobs:
 
 
   build:
   build:
     name: Build
     name: Build
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macos-latest, windows-latest]
+        include:
+        - os: ubuntu-latest
+          path: |
+            ~/.cache/go-build
+            ~/go/pkg/mod
+        - os: macos-latest
+          path: |
+            ~/Library/Caches/go-build
+            ~/go/pkg/mod
+        - os: windows-latest
+          path: |
+            %LocalAppData%\go-build
+            ~/go/pkg/mod
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     steps:
     steps:
+      - name: Set up Go 1.13
+        uses: actions/setup-go@v1
+        with:
+          go-version: 1.13
+        id: go
 
 
-    - name: Set up Go 1.13
-      uses: actions/setup-go@v1
-      with:
-        go-version: 1.13
-      id: go
-
-    - name: Check out code into the Go module directory
-      uses: actions/checkout@v2
-
-    - name: cache
-      id: cache
-      uses: actions/cache@v1
-      with:
-        path: ~/go/pkg/mod
-        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
-        restore-keys: |
-          ${{ runner.os }}-go-
-
-    - name: Get dependencies
-      run: |
-        go get -v -t -d ./...
-        if [ -f Gopkg.toml ]; then
-            curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
-            dep ensure
-        fi
-      working-directory: ./server
-
-    - name: Build
-      run: go build -v . -o output
-      working-directory: ./server
-
-    - name: artifact
-      uses: actions/upload-artifact@v1
-      with:
-        name: artifact
-        path: output
-
-    - name: Run GoReleaser
-      uses: goreleaser/goreleaser-action@v1
-      with:
-        version: latest
-        args: release --rm-dist
-        key: ${{ secrets.YOUR_PRIVATE_KEY }}
-      env:
-        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+      - name: Check out code into the Go module directory
+        uses: actions/checkout@v2
+
+      - name: cache
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: ${{ matrix.path }}
+          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
+          restore-keys: |
+            ${{ runner.os }}-go-
+
+      - name: Get dependencies
+        run: |
+          go get -v -t -d ./...
+          if [ -f Gopkg.toml ]; then
+              curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
+              dep ensure
+          fi
+        working-directory: ./server
+
+      - name: Build
+        run: go build -v . -o output
+        working-directory: ./server
+
+      - name: artifact
+        uses: actions/upload-artifact@v1
+        with:
+          name: artifact
+          path: output
+
+      - name: Run GoReleaser
+        uses: goreleaser/goreleaser-action@v1
+        with:
+          version: latest
+          args: release --rm-dist
+          key: ${{ secrets.YOUR_PRIVATE_KEY }}
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

+ 41 - 0
ios/build.yml

@@ -0,0 +1,41 @@
+name: CI
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  build:
+    strategy:
+      matrix:
+        node-version: [12.x]
+    runs-on: macOS-latest
+    steps:
+      - name: Check out branch
+        uses: actions/checkout@v2
+
+      - name: Swift, Objective-C - Carthage
+        uses: actions/cache@v2
+        with:
+          path: Carthage
+          key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
+
+      - name: Swift, Objective-C - CocoaPods
+        uses: actions/cache@v2
+        with:
+          path: Pods
+          key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-pods-
+
+      - name: Carthage
+        if: steps.carthage-cache.outputs.cache-hit != 'true'
+        run: |
+          carthage bootstrap --no-use-binaries --platform iOS --cache-builds
+
+      - name: Bundle Install
+        run: bundle install --deployment
+      - name: Cocoapods
+        run: bundle exec pod install

+ 18 - 8
java/.github/workflows/main.yml

@@ -13,12 +13,22 @@ jobs:
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
     steps:
     steps:
       - name: Check out code
       - name: Check out code
-      uses: actions/checkout@v2
+        uses: actions/checkout@v2
+
+      - name: Cache local Maven repository
+        uses: actions/cache@v2
+        with:
+          path: ~/.m2/repository
+          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          restore-keys: |
+            ${{ runner.os }}-maven-
+
+      - uses: actions/cache@v2
+        with:
+          path: |
+            ~/.gradle/caches
+            ~/.gradle/wrapper
+          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
+          restore-keys: |
+            ${{ runner.os }}-gradle-
 
 
-      - name: cache
-      uses: actions/cache@v1
-      with:
-        path: ~/.m2/repository
-        key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
-        restore-keys: |
-          ${{ runner.os }}-maven-

+ 39 - 20
nodejs/.github/workflows/main.yml

@@ -1,22 +1,41 @@
-- name: Get npm cache directory
-  id: npm-cache
-  run: |
-    echo "::set-output name=dir::$(npm config get cache)"
-- uses: actions/cache@v1
-  with:
-    path: ${{ steps.npm-cache.outputs.dir }}
-    key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
-    restore-keys: |
-      ${{ runner.os }}-node-
+name: CI
 
 
-- name: Get yarn cache directory path
-  id: yarn-cache-dir-path
-  run: echo "::set-output name=dir::$(yarn cache dir)"
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
 
 
-- uses: actions/cache@v1
-  id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
-  with:
-    path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
-    key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
-    restore-keys: |
-      ${{ runner.os }}-yarn-
+jobs:
+  build:
+    strategy:
+      matrix:
+        node-version: [12.x]
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check out branch
+        uses: actions/checkout@v2
+
+      - name: Get npm cache directory
+        id: npm-cache-dir
+        run: |
+          echo "::set-output name=dir::$(npm config get cache)"
+      - uses: actions/cache@v2
+        id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
+        with:
+          path: ${{ steps.npm-cache-dir.outputs.dir }}
+          key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
+          restore-keys: |
+            ${{ runner.os }}-node-
+
+      - name: Get yarn cache directory path
+        id: yarn-cache-dir-path
+        run: echo "::set-output name=dir::$(yarn cache dir)"
+
+      - uses: actions/cache@v2
+        id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
+        with:
+          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
+          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-yarn-

+ 28 - 10
php/.github/workflows/main.yml

@@ -1,10 +1,28 @@
-  - name: Get Composer Cache Directory
-    id: composer-cache
-    run: |
-      echo "::set-output name=dir::$(composer config cache-files-dir)"
-  - uses: actions/cache@v1
-    with:
-      path: ${{ steps.composer-cache.outputs.dir }}
-      key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
-      restore-keys: |
-        ${{ runner.os }}-composer-
+name: CI
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  build:
+    strategy:
+      matrix:
+        node-version: [12.x]
+    runs-on: ubuntu-latest
+    steps:
+      - name: Check out branch
+        uses: actions/checkout@v2
+
+      - name: Get Composer Cache Directory
+        id: composer-cache
+        run: |
+          echo "::set-output name=dir::$(composer config cache-files-dir)"
+      - uses: actions/cache@v2
+        with:
+          path: ${{ steps.composer-cache.outputs.dir }}
+          key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-composer-

+ 23 - 9
python/.github/workflows/autoci.yml

@@ -10,30 +10,44 @@ on:
 
 
 jobs:
 jobs:
   build:
   build:
-
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macos-latest, windows-latest]
+        include:
+        - os: ubuntu-latest
+          path: ~/.cache/pip
+        - os: macos-latest
+          path: ~/Library/Caches/pip
+        - os: windows-latest
+          path: ~\AppData\Local\pip\Cache
     runs-on: ubuntu-latest
     runs-on: ubuntu-latest
 
 
     steps:
     steps:
       - uses: actions/checkout@v2
       - uses: actions/checkout@v2
         
         
       - name: Set up Python 3.8
       - name: Set up Python 3.8
+        id: setup-python
         uses: actions/setup-python@v2
         uses: actions/setup-python@v2
         with:
         with:
           python-version: 3.8
           python-version: 3.8
 
 
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade pip
-          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
-
-      - uses: actions/cache@v1
-        if: startsWith(runner.os, 'Linux')
+      - uses: actions/cache@v2
         with:
         with:
-          path: ~/.cache/pip
+          path: ${{ matrix.path }}
           key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
           key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
           restore-keys: |
           restore-keys: |
             ${{ runner.os }}-pip-
             ${{ runner.os }}-pip-
 
 
+      - uses: actions/cache@v2
+        with:
+          path: ~/.local/share/virtualenvs
+          key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}
+        
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+  
       - name: Update Deny Host
       - name: Update Deny Host
         run: |
         run: |
           pwd
           pwd

+ 0 - 23
python/.github/workflows/cache.yml

@@ -1,23 +0,0 @@
-- uses: actions/cache@v1
-  if: startsWith(runner.os, 'Linux')
-  with:
-    path: ~/.cache/pip
-    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
-    restore-keys: |
-      ${{ runner.os }}-pip-
-
-- uses: actions/cache@v1
-  if: startsWith(runner.os, 'macOS')
-  with:
-    path: ~/Library/Caches/pip
-    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
-    restore-keys: |
-      ${{ runner.os }}-pip-
-
-- uses: actions/cache@v1
-  if: startsWith(runner.os, 'Windows')
-  with:
-    path: ~\AppData\Local\pip\Cache
-    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
-    restore-keys: |
-      ${{ runner.os }}-pip-

+ 33 - 0
ruby/build.yml

@@ -0,0 +1,33 @@
+name: CI
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  build:
+    strategy:
+      matrix:
+        node-version: [12.x]
+    runs-on: ubuntu-latest
+    steps:
+    - name: Check out branch
+      uses: actions/checkout@v2
+
+    - name: Cache RubyGems
+      uses: actions/cache@v2
+      with:
+        path: vendor/bundle
+        key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
+        restore-keys: |
+          ${{ runner.os }}-gem-
+
+    - name: Cache Mint packages
+      uses: actions/cache@v1
+      with:
+        path: ${{ env.MINT_PATH }}
+        key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
+        restore-keys: ${{ runner.os }}-mint-
+        

+ 2 - 2
vue/.github/workflows/deploy_aliyun_oss.yml

@@ -17,8 +17,8 @@ jobs:
     - uses: srt32/git-actions@v0.0.3
     - uses: srt32/git-actions@v0.0.3
       with:
       with:
         args: git submodule update --init --recursive
         args: git submodule update --init --recursive
-
-	- name: use Node.js 10.x
+        
+    - name: use Node.js 10.x
       uses: actions/setup-node@v1
       uses: actions/setup-node@v1
       with:
       with:
         node-version: 10.x
         node-version: 10.x