Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f14f697428 | ||
|
|
4f518e78a5 | ||
|
|
5bb659f76c | ||
|
|
0fe81a0d42 | ||
|
|
c70d561c53 |
+58
-2
@@ -1,11 +1,33 @@
|
||||
name: "Project Manager"
|
||||
|
||||
inputs:
|
||||
# python
|
||||
python-version:
|
||||
default: "3.14"
|
||||
setup-python:
|
||||
default: false
|
||||
type: boolean
|
||||
required: false
|
||||
venv-version:
|
||||
default: "1"
|
||||
# nodejs
|
||||
nodejs-version:
|
||||
default: "24.x"
|
||||
setup-nodejs:
|
||||
type: boolean
|
||||
required: false
|
||||
node_modules-version:
|
||||
default: "1"
|
||||
# haxetool
|
||||
setup-haxetool:
|
||||
type: boolean
|
||||
required: false
|
||||
haxetool_sdk-version:
|
||||
default: "1"
|
||||
|
||||
env:
|
||||
NPM_CONFIG_AUDIT: false
|
||||
NPM_CONFIG_FUND: false
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
@@ -20,8 +42,9 @@ runs:
|
||||
--index-url https://git.shmyga.ru/api/packages/InfernalGames/pypi/simple/ \
|
||||
--extra-index-url https://pypi.org/simple
|
||||
|
||||
- run: pm setup:config -vv
|
||||
- run: pm setup:config -i -vv
|
||||
|
||||
# setup python
|
||||
- if: inputs.setup-python
|
||||
run: pip install poetry
|
||||
|
||||
@@ -34,3 +57,36 @@ runs:
|
||||
|
||||
- if: ${{ inputs.setup-python && steps.cache-venv.outputs.cache-hit != 'true' }}
|
||||
run: pm setup:python -vv
|
||||
|
||||
# setup nodejs
|
||||
- if: ${{ inputs.setup-haxetool || inputs.setup-nodejs }}
|
||||
uses: actions/setup-node@v7
|
||||
with:
|
||||
node-version: ${{ inputs.nodejs-version }}
|
||||
cache: "npm"
|
||||
|
||||
- id: cache-node_modules
|
||||
if: ${{ inputs.setup-haxetool || inputs.setup-nodejs }}
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: node_modules
|
||||
key: node_modules-${{ runner.os }}-nodejs-${{ inputs.nodejs-version }}-${{ hashFiles('**/package-lock.json') }}-v${{ inputs.node_modules-version }}
|
||||
|
||||
- if: ${{ (inputs.setup-haxetool || inputs.setup-nodejs) && steps.cache-node_modules.outputs.cache-hit != 'true' }}
|
||||
run: pm setup:nodejs -vv
|
||||
|
||||
# setup haxetool
|
||||
- if: inputs.setup-haxetool
|
||||
uses: actions/cache/restore@v6
|
||||
id: cache-haxetool
|
||||
with:
|
||||
key: ${{ runner.os }}-haxetool-${{ hashFiles('**/haxetool.json') }}-v${{ inputs.haxetool_sdk-version }}
|
||||
path: /root/sdk
|
||||
- if: steps.cache-haxetool.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
npx hxt app:flash:setup
|
||||
- if: steps.cache-haxetool.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v6
|
||||
with:
|
||||
key: ${{ steps.cache-haxetool.outputs.cache-primary-key }}
|
||||
path: /root/sdk
|
||||
|
||||
@@ -52,8 +52,6 @@ class ProjectManager:
|
||||
except:
|
||||
self._logger.exception(entry)
|
||||
counter[ResultType.FAILED] += 1
|
||||
if not counter:
|
||||
raise RuntimeError(f'Task not found "{key}"')
|
||||
self._logger.info(
|
||||
"%s", "\n".join(f"{RESULT_ICONS[k]} {v}" for k, v in counter.items())
|
||||
)
|
||||
|
||||
@@ -16,10 +16,12 @@ class ProjectManagerRunner:
|
||||
*,
|
||||
path: Path,
|
||||
task_key: PartialTaskKey,
|
||||
ignore: bool = False,
|
||||
verbose: int = 0,
|
||||
):
|
||||
self._path = path
|
||||
self._task_key = task_key
|
||||
self._ignore = ignore
|
||||
self._verbose = verbose
|
||||
|
||||
@classmethod
|
||||
@@ -47,6 +49,8 @@ class ProjectManagerRunner:
|
||||
self._setup_logging(self._verbose)
|
||||
manager = ProjectManager(self._path)
|
||||
result = manager.run_task(self._task_key)
|
||||
if not self._ignore and not result:
|
||||
raise RuntimeError(f'Task not found "{self._task_key}"')
|
||||
if result["failed"] > 0:
|
||||
sys.exit(1)
|
||||
|
||||
@@ -59,6 +63,7 @@ class ProjectManagerRunner:
|
||||
default="show",
|
||||
)
|
||||
parser.add_argument("-p", "--path", type=Path, default=Path.cwd())
|
||||
parser.add_argument("-i", "--ignore", action="store_true")
|
||||
parser.add_argument("-v", "--verbose", action="count", default=1)
|
||||
parser.add_argument("-q", "--quiet", action="store_true")
|
||||
parser.add_argument("--version", action="store_true")
|
||||
@@ -68,4 +73,6 @@ class ProjectManagerRunner:
|
||||
sys.exit(0)
|
||||
verbose = -1 if args.quiet else args.verbose
|
||||
task_key = PartialTaskKey.from_str(args.task)
|
||||
return cls(path=args.path, task_key=task_key, verbose=verbose)
|
||||
return cls(
|
||||
path=args.path, task_key=task_key, ignore=args.ignore, verbose=verbose
|
||||
)
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "project-manager"
|
||||
description = ""
|
||||
version = "0.5.1"
|
||||
version = "0.6.1"
|
||||
readme = "README.md"
|
||||
authors = [{ name = "shmyga", email = "shmyga.z@gmail.com" }]
|
||||
requires-python = ">=3.14,<4.0"
|
||||
|
||||
Reference in New Issue
Block a user