mirror of
https://github.com/ivuorinen/actions.git
synced 2026-02-02 14:42:13 +00:00
refactor: inline node-setup across Node.js actions
Phase 6A: Remove node-setup abstraction layer and inline Node.js setup. Changes: - Replace node-setup calls with direct actions/setup-node@v6.0.0 - Inline package manager detection (lockfile-based) - Add Corepack enablement and package manager installation - Use Node.js 22 as default version Actions migrated (5): - prettier-lint: Inline Node.js setup + package manager detection - biome-lint: Inline Node.js setup + package manager detection - eslint-lint: Inline Node.js setup + package manager detection - pr-lint: Inline Node.js setup (conditional on package.json) - npm-publish: Inline Node.js setup + package manager detection Removed: - node-setup/action.yml (371 lines) - node-setup/README.md, rules.yml, CustomValidator.py - _tests/unit/node-setup/validation.spec.sh - _tests/integration/workflows/node-setup-test.yml - validate-inputs/tests/test_node-setup_custom.py Documentation updates: - CLAUDE.md: Remove node-setup from action list (26 actions) - generate_listing.cjs: Remove node-setup mappings - update-validators.py: Remove node-setup custom validator Result: 26 actions (down from 27), eliminated internal dependency layer.
This commit is contained in:
@@ -311,9 +311,6 @@ class ValidationRuleGenerator:
|
||||
"backoff-strategy": "backoff_strategy",
|
||||
"shell": "shell_type",
|
||||
},
|
||||
"node-setup": {
|
||||
"package-manager": "package_manager_enum",
|
||||
},
|
||||
"docker-publish": {
|
||||
"registry": "registry_enum",
|
||||
"cache-mode": "cache_mode",
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
"""Tests for node-setup custom validator.
|
||||
|
||||
Generated by generate-tests.py - Do not edit manually.
|
||||
"""
|
||||
# pylint: disable=invalid-name # Test file name matches action name
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Add action directory to path to import custom validator
|
||||
action_path = Path(__file__).parent.parent.parent / "node-setup"
|
||||
sys.path.insert(0, str(action_path))
|
||||
|
||||
# pylint: disable=wrong-import-position
|
||||
from CustomValidator import CustomValidator
|
||||
|
||||
|
||||
class TestCustomNodeSetupValidator:
|
||||
"""Test cases for node-setup custom validator."""
|
||||
|
||||
def setup_method(self):
|
||||
"""Set up test fixtures."""
|
||||
self.validator = CustomValidator("node-setup")
|
||||
|
||||
def teardown_method(self):
|
||||
"""Clean up after tests."""
|
||||
self.validator.clear_errors()
|
||||
|
||||
def test_validate_inputs_valid(self):
|
||||
"""Test validation with valid inputs."""
|
||||
# TODO: Add specific valid inputs for node-setup
|
||||
inputs = {}
|
||||
result = self.validator.validate_inputs(inputs)
|
||||
# Adjust assertion based on required inputs
|
||||
assert isinstance(result, bool)
|
||||
|
||||
def test_validate_inputs_invalid(self):
|
||||
"""Test validation with invalid inputs."""
|
||||
# TODO: Add specific invalid inputs for node-setup
|
||||
inputs = {"invalid_key": "invalid_value"}
|
||||
result = self.validator.validate_inputs(inputs)
|
||||
# Custom validators may have specific validation rules
|
||||
assert isinstance(result, bool)
|
||||
|
||||
def test_required_inputs(self):
|
||||
"""Test required inputs detection."""
|
||||
required = self.validator.get_required_inputs()
|
||||
assert isinstance(required, list)
|
||||
# TODO: Assert specific required inputs for node-setup
|
||||
|
||||
def test_validation_rules(self):
|
||||
"""Test validation rules."""
|
||||
rules = self.validator.get_validation_rules()
|
||||
assert isinstance(rules, dict)
|
||||
# TODO: Assert specific validation rules for node-setup
|
||||
|
||||
def test_github_expressions(self):
|
||||
"""Test GitHub expression handling."""
|
||||
inputs = {
|
||||
"test_input": "${{ github.token }}",
|
||||
}
|
||||
result = self.validator.validate_inputs(inputs)
|
||||
assert isinstance(result, bool)
|
||||
# GitHub expressions should generally be accepted
|
||||
|
||||
def test_error_propagation(self):
|
||||
"""Test error propagation from sub-validators."""
|
||||
# Custom validators often use sub-validators
|
||||
# Test that errors are properly propagated
|
||||
inputs = {"test": "value"}
|
||||
self.validator.validate_inputs(inputs)
|
||||
# Check error handling
|
||||
if self.validator.has_errors():
|
||||
assert len(self.validator.errors) > 0
|
||||
Reference in New Issue
Block a user