This commit is contained in:
root 2023-02-16 18:16:37 +00:00
parent 9e8dbc86a6
commit 8cdba315b7
7 changed files with 1168 additions and 7605 deletions

View File

@ -1,7 +0,0 @@
{
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"prettier"
]
}

View File

@ -11,6 +11,4 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: npm ci - run: npm ci
# - run: npm run lint
- run: npm run build
- run: npm run test - run: npm run test

8733
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +1,29 @@
{ {
"name": "action-cargo", "name": "action-cargo",
"version": "1.0.3", "version": "0.0.1",
"private": false, "private": false,
"description": "Run cargo command", "description": "Run cargo command",
"main": "src/main.js",
"type": "module", "type": "module",
"main": "src/main.js",
"directories": { "directories": {
"test": "__tests__" "test": "__tests__"
}, },
"scripts": { "scripts": {
"bundle": "cp -r .matchers ./dist/", "test": "NODE_OPTIONS=--experimental-vm-modules npx jest -c jest.config.json"
"build": "npm run bundle",
"format": "prettier --write 'src/**/*.ts' '__tests__/**/*.ts'",
"lint": "tsc --noEmit && eslint 'src/**/*.ts' '__tests__/**/*.ts'",
"test": "jest -c jest.config.json"
},
"repository": {
"type": "git",
"url": "git+https://github.com/actions-rs/cargo.git"
}, },
"keywords": [ "keywords": [
"actions", "actions",
"rust", "rust",
"cargo" "cargo"
], ],
"author": "actions-rs",
"license": "MIT", "license": "MIT",
"bugs": {
"url": "https://github.com/actions-rs/cargo/issues"
},
"dependencies": { "dependencies": {
"@actions/core": "^1.2.4", "@actions/core": "^1.2.4",
"action-core": "git+https://github.com/synthet-ic/action-core.git", "action-core": "git+https://github.com/synthet-ic/action-core.git",
"string-argv": "^0.3.1" "string-argv": "^0.3.1"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "^29.4.2", "jest": "^29.4.2",
"jest-circus": "^29.4.2", "jest-circus": "^29.4.2"
"npm-check-updates": "^16.7.4",
"prettier": "^2.8.4"
} }
} }

View File

@ -4,7 +4,7 @@
import { input } from "action-core"; import { input } from "action-core";
import stringArgv from "string-argv"; import { parseArgsStringToArgv } from "string-argv";
// Parsed action input // Parsed action input
// export interface Input { // export interface Input {
@ -16,7 +16,7 @@ import stringArgv from "string-argv";
export function get() { export function get() {
const command = input.getInput("command", { required: true }); const command = input.getInput("command", { required: true });
const args = stringArgv(input.getInput("args")); const args = parseArgsStringToArgv(input.getInput("args"));
let toolchain = input.getInput("toolchain"); let toolchain = input.getInput("toolchain");
if (toolchain.startsWith("+")) { if (toolchain.startsWith("+")) {
toolchain = toolchain.slice(1); toolchain = toolchain.slice(1);

View File

@ -30,7 +30,7 @@ async function main() {
try { try {
await run(actionInput); await run(actionInput);
} catch (error) { } catch (error) {
core.setFailed((<Error>error).message); core.setFailed(error.message);
} }
} }