From e143d36b9343df6a835ba3d81c54aa752b278a51 Mon Sep 17 00:00:00 2001 From: Quang Lam Date: Mon, 15 Jun 2020 09:01:51 +0700 Subject: [PATCH] Improve caching stability for GH Actions (#194) --- .github/workflows/linux.yml | 13 +-------- .github/workflows/macos.yml | 13 +-------- .github/workflows/windows.yml | 13 +-------- test.js | 55 ----------------------------------- 4 files changed, 3 insertions(+), 91 deletions(-) delete mode 100644 test.js diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index df9b4718..8709c5db 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -38,18 +38,7 @@ jobs: key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - - name: Cache node_modules - id: cache-node-modules - uses: actions/cache@v1 - with: - path: node_modules - key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.node-version }}-nodemodules- - - run: yarn - if: | - steps.cache-yarn-cache.outputs.cache-hit != 'true' || - steps.cache-node-modules.outputs.cache-hit != 'true' + - run: yarn --prefer-offline - run: yarn lint - name: Get tag name run: echo ::set-env name=CI_BUILD_TAG::${GITHUB_REF/refs\/tags\//} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b2060b7a..7a209082 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -31,18 +31,7 @@ jobs: key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - - name: Cache node_modules - id: cache-node-modules - uses: actions/cache@v1 - with: - path: node_modules - key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.node-version }}-nodemodules- - - run: yarn - if: | - steps.cache-yarn-cache.outputs.cache-hit != 'true' || - steps.cache-node-modules.outputs.cache-hit != 'true' + - run: yarn --prefer-offline - run: yarn lint - name: Get tag name run: echo ::set-env name=CI_BUILD_TAG::${GITHUB_REF/refs\/tags\//} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9d302cf9..6b92120f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -31,18 +31,7 @@ jobs: key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- - - name: Cache node_modules - id: cache-node-modules - uses: actions/cache@v1 - with: - path: node_modules - key: ${{ runner.os }}-${{ matrix.node-version }}-nodemodules-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-${{ matrix.node-version }}-nodemodules- - - run: yarn - if: | - steps.cache-yarn-cache.outputs.cache-hit != 'true' || - steps.cache-node-modules.outputs.cache-hit != 'true' + - run: yarn --prefer-offline - run: yarn lint - name: Get tag name run: echo ::set-env name=CI_BUILD_TAG::${GITHUB_REF/refs\/tags\//} diff --git a/test.js b/test.js deleted file mode 100644 index 76e5f62b..00000000 --- a/test.js +++ /dev/null @@ -1,55 +0,0 @@ -/* eslint-disable */ -// extracted from Google Translate Chrome extension -// retrived from aapbdbdomjkkjkaonfhkkikfgjllcleb/popup_compiled.js - -let Tb = null; - -function Sb(a, b) { - for (let c = 0; c < b.length - 2; c += 3) { - let d = b.charAt(c + 2); - d = "a" <= d ? d.charCodeAt(0) - 87 : Number(d); - d = "+" == b.charAt(c + 1) ? a >>> d : a << d; - a = "+" == b.charAt(c) ? a + d & 4294967295 : a ^ d - } - return a -}; - -function Rb(a) { - return function() { - return a; - }; -} - -function Ub(a) { - if (null !== Tb) var b = Tb; - else { - b = Rb(String.fromCharCode(84)); - var c = Rb(String.fromCharCode(75)); - b = [b(), b()]; - b[1] = c(); - // b = (Tb = window[b.join(c())] || "") || "" - // window[b.join(c())] is TKK. See https://github.com/matheuss/google-translate-token - // The extension is not using TKK at all, so we can just ignore it` - b = (Tb = "") || "" - } - var d = Rb(String.fromCharCode(116)); - c = Rb(String.fromCharCode(107)); - d = [d(), d()]; - d[1] = c(); - c = "&" + d.join("") + "="; - d = b.split("."); - b = Number(d[0]) || 0; - for (var e = [], f = 0, g = 0; g < a.length; g++) { - var k = a.charCodeAt(g); - 128 > k ? e[f++] = k : (2048 > k ? e[f++] = k >> 6 | 192 : (55296 == (k & 64512) && g + 1 < a.length && 56320 == (a.charCodeAt(g + 1) & 64512) ? (k = 65536 + ((k & 1023) << 10) + (a.charCodeAt(++g) & 1023), e[f++] = k >> 18 | 240, e[f++] = k >> 12 & 63 | 128) : e[f++] = k >> 12 | 224, e[f++] = k >> 6 & 63 | 128), e[f++] = k & 63 | 128) - } - a = b; - for (f = 0; f < e.length; f++) a += e[f], a = Sb(a, "+-a^+6"); - a = Sb(a, "+-3^+b+-f"); - a ^= Number(d[1]) || 0; - 0 > a && (a = (a & 2147483647) + 2147483648); - a %= 1E6; - // return c + (a.toString() + "." + (a ^ b)); - // c == '&tk=' so strip it away - return (a.toString() + "." + (a ^ b)); -};