Skip to content

v4.1.0

Choose a tag to compare

@github-actions github-actions released this 01 Oct 22:19
· 21 commits to main since this release
7e38e21

🚀[Feature]: Test Setup & Teardown Support for GitHub Actions Workflows (#191)

Overview

This release introduces automated test environment management through BeforeAll.ps1 and AfterAll.ps1 scripts, enabling comprehensive setup and teardown capabilities for module tests running in GitHub Actions. This enhancement solves the challenge of managing complex test environments (databases, infrastructure, external services) across parallel test matrices while ensuring proper cleanup regardless of test outcomes.

🎯 Main Feature: Test Lifecycle Management

The Problem

Previously, setting up test infrastructure required:

  • Rate-limiting issue when creating GitHub Repositories for the GitHub PowerShell module, where the setup and teardown happens in the individual test files via BeforeAll and AfterAll blocks.

The Solution

Dedicated setup and teardown jobs with automatic script execution:

  • BeforeAll: Runs once before all test matrix jobs begin.
  • AfterAll: Runs once after all test matrix jobs complete.

Configuration

No configuration needed! Simply add scripts to your test directory.
The workflow automatically detects and executes these scripts when present.

your-module/
├── tests/
│   ├── BeforeAll.ps1      ← Setup script (optional)
│   ├── AfterAll.ps1       ← Teardown script (optional)
│   └── Module.Tests.ps1   ← The tests that require external setup
│

Additional: Specification-Driven Development Framework

This release also includes an implementation of spec-kit principles, adding a structured workflow for feature development from specification through implementation.

What's Included

  • Prompt templates (.github/prompts/) for /specify, /clarify, /plan, /tasks, /analyze, /implement commands
  • Project constitution (.specify/memory/constitution.md) defining architectural principles:

Additional Workflow Improvements

Linter Configuration Updates

  • Added VALIDATE_BIOME_FORMAT: false for Biome formatter
  • Added VALIDATE_GITHUB_ACTIONS_ZIZMOR: false for workflow security scanning
  • Added VALIDATE_JSCPD: false for copy-paste detection
  • Consistent linting configuration across Build-Docs and Linter workflows

Test Workflow Enhancements

  • Environment variables properly scoped at workflow level
  • Clearer parameter naming (OSName vs OS)
  • Improved test execution coordination

Documentation

  • Comprehensive setup/teardown guide in README.md
  • Inline documentation in all prompt templates and scripts
  • Usage examples for common test scenarios