Signed-off-by: Xuanwo <github@xuanwo.io>
This commit is contained in:
Xuanwo
2023-01-10 12:39:09 +08:00
parent 835e255d1d
commit 82bd256572
6 changed files with 3725 additions and 4 deletions

32
.eslintrc.json Normal file
View File

@@ -0,0 +1,32 @@
{
"env": {
"node": true,
"jest": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended"
],
"plugins": [
"@typescript-eslint",
"simple-import-sort",
"jest"
],
"rules": {
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"simple-import-sort/imports": "error",
"sort-imports": "off"
}
}

View File

@@ -12,12 +12,29 @@
# See the License for the specific language governing permissions and
# limitations under the License.
name: Test sccache
name: CI
on: [push, pull_request]
jobs:
v0_3_3:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: npm
- name: Prettier Format Check
run: npm run format-check
- name: ESLint Check
run: npm run lint
- name: Build & Test
run: npm run test
test_v0_3_3:
name: Test version 0.3.3
runs-on: ${{ matrix.os }}
strategy:
@@ -35,6 +52,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: npm
- name: npm install
run: npm install

2
.gitignore vendored
View File

@@ -1,2 +1,4 @@
node_modules/
lib/
# Cache file of eslint
.eslintcache

3661
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -9,6 +9,7 @@
"build": "prettier --write **/*.ts && tsc && ncc build lib/sccache.js",
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint **/*.ts --cache",
"test": "jest"
},
"repository": {
@@ -37,6 +38,13 @@
"jest-circus": "^29.3.1",
"prettier": "^2.8.1",
"ts-jest": "^27.1.4",
"typescript": "^4.9.4"
"typescript": "^4.9.4",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.9.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^7.0.0"
}
}

View File

@@ -35,7 +35,7 @@ async function setup() {
// Download and extract.
const sccachePackage = await downloadTool(downloadUrl);
var sccachePath;
let sccachePath;
if (getExtension() == 'zip') {
sccachePath = await extractZip(sccachePackage);
} else {