瀏覽代碼

ci(workflow): add cache to workflows using actions/setup-node (#2740)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Oscar Dominguez 3 年之前
父節點
當前提交
651fc01492

+ 3 - 2
.github/workflows/build-smoke-tests.yml

@@ -57,10 +57,11 @@ jobs:
           ref: ${{ github.event.inputs.ref }}
           path: example
       - name: setup node
-        uses: actions/setup-node@v1
+        uses: actions/setup-node@v2
         with:
           node-version: 14
-      - name: install rust stable
+          cache: yarn
+          cache-dependency-path: tooling/*/yarn.lock
         uses: actions-rs/toolchain@v1
         with:
           toolchain: stable

+ 4 - 2
.github/workflows/covector-version-or-publish.yml

@@ -22,10 +22,12 @@ jobs:
       - uses: actions/checkout@v2
         with:
           fetch-depth: 0
-      - uses: actions/setup-node@v1
+      - uses: actions/setup-node@v2
         with:
           node-version: 14
           registry-url: "https://registry.npmjs.org"
+          cache: yarn
+          cache-dependency-path: tooling/*/yarn.lock
       - name: cargo login
         run: cargo login ${{ secrets.crate_token }}
       - name: git config
@@ -125,7 +127,7 @@ jobs:
 
       - uses: iamsauravsharma/create-dotenv@v1.1.0
         with:
-          directory: './tauri-search-bot'
+          directory: "./tauri-search-bot"
         env:
           ENV_KEY_DISCORD_BOT_SECRET: ${{ secrets.DISCORD_BOT_SECRET }}
           ENV_KEY_PREFIX: \!

+ 8 - 6
.github/workflows/js-lint.yml

@@ -7,19 +7,21 @@ name: eslint check
 on:
   pull_request:
     paths:
-      - '.github/workflows/js-lint.yml'
-      - 'tooling/cli.js/**'
-      - 'tooling/api/**'
-      - 'tooling/create-tauri-app/**'
+      - ".github/workflows/js-lint.yml"
+      - "tooling/cli.js/**"
+      - "tooling/api/**"
+      - "tooling/create-tauri-app/**"
 
 jobs:
   eslint-check:
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
-      - uses: actions/setup-node@v1
+      - uses: actions/setup-node@v2
         with:
-          node-version: '12'
+          node-version: "12"
+          cache: yarn
+          cache-dependency-path: tooling/*/yarn.lock
       - name: install cli.js deps via yarn
         working-directory: ./tooling/cli.js/
         run: yarn

+ 7 - 1
.github/workflows/test-core.yml

@@ -158,11 +158,17 @@ jobs:
 
     steps:
       - uses: actions/checkout@v2
-      - name: install stable
+      - name: install Rust stable
         uses: actions-rs/toolchain@v1
         with:
           toolchain: stable
           override: true
+      - name: setup node
+        uses: actions/setup-node@v2
+        with:
+          node-version: 14
+          cache: yarn
+          cache-dependency-path: tooling/cli.js/yarn.lock
       - name: install webkit2gtk (ubuntu only)
         if: matrix.platform == 'ubuntu-latest'
         run: |

+ 1 - 1
docs/usage/guides/bundler/sign-osx.md

@@ -72,7 +72,7 @@ jobs:
     steps:
     - uses: actions/checkout@v2
     - name: setup node
-      uses: actions/setup-node@v1
+      uses: actions/setup-node@v2
       with:
         node-version: 12
     - name: install Rust stable

+ 1 - 1
docs/usage/guides/webdriver/ci.md

@@ -69,7 +69,7 @@ jobs:
 
       # install the latest stable node version at the time of writing
       - name: Node v16
-        uses: actions/setup-node@v1
+        uses: actions/setup-node@v2
         with:
           node-version: 16.x
 

+ 1 - 1
tooling/cli.rs/templates/plugin/backend/.github/workflows/covector-version-or-publish.yml

@@ -13,7 +13,7 @@ jobs:
       - uses: actions/checkout@v2
         with:
           fetch-depth: 0
-      - uses: actions/setup-node@v1
+      - uses: actions/setup-node@v2
         with:
           node-version: 12
           registry-url: 'https://registry.npmjs.org'

+ 1 - 1
tooling/cli.rs/templates/plugin/with-api/.github/workflows/covector-version-or-publish.yml

@@ -13,7 +13,7 @@ jobs:
       - uses: actions/checkout@v2
         with:
           fetch-depth: 0
-      - uses: actions/setup-node@v1
+      - uses: actions/setup-node@v2
         with:
           node-version: 12
           registry-url: 'https://registry.npmjs.org'