gasket-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Pre-Push Validator Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,193 @@
1
+ Metadata-Version: 2.4
2
+ Name: gasket-cli
3
+ Version: 0.1.0
4
+ Summary: Run GitHub Actions locally using nektos/act from a Python CLI
5
+ Author-email: hieu_trincao <kaiinredtie@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/hieupham259/gasket
8
+ Project-URL: Repository, https://github.com/hieupham259/gasket
9
+ Project-URL: Issues, https://github.com/hieupham259/gasket/issues
10
+ Keywords: github-actions,act,ci,local,docker,workflow
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Software Development :: Build Tools
21
+ Classifier: Topic :: Software Development :: Testing
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: click>=8.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=7.0; extra == "dev"
28
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
29
+ Requires-Dist: mypy>=1.0; extra == "dev"
30
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
31
+ Dynamic: license-file
32
+
33
+ # Gasket
34
+
35
+ A Python CLI tool that wraps [nektos/act](https://github.com/nektos/act) to run
36
+ GitHub Actions workflows locally via Docker.
37
+
38
+ Built with [Click](https://click.palletsprojects.com/) for composable commands.
39
+
40
+ ## Prerequisites
41
+
42
+ - **Python 3.10+**
43
+ - **Docker** - must be installed and running
44
+ - **nektos/act** - installed automatically via `gasket setup install-act`
45
+
46
+ ## Installation
47
+
48
+ ```bash
49
+ # Clone the repository
50
+ git clone <repo-url>
51
+ cd gasket
52
+
53
+ # Create virtual environment
54
+ python -m venv .venv
55
+ source .venv/bin/activate # Linux/macOS
56
+ # .venv\Scripts\activate # Windows
57
+
58
+ # Install in development mode
59
+ pip install -e ".[dev]"
60
+
61
+ # Install act (if not already installed)
62
+ gasket setup install-act
63
+
64
+ # Verify installation
65
+ gasket --version
66
+ gasket --help
67
+ ```
68
+
69
+ Or use the standalone installer:
70
+
71
+ ```bash
72
+ python install.py
73
+ ```
74
+
75
+ ## Commands
76
+
77
+ ### run-act
78
+
79
+ Run GitHub Actions workflows locally using nektos/act.
80
+
81
+ ```bash
82
+ gasket run-act # Run push event workflows
83
+ gasket run-act --event pull_request # Run pull_request workflows
84
+ gasket run-act --list # List available workflows
85
+ gasket run-act --dry-run # Dry run only
86
+ gasket run-act -j test # Run specific job
87
+ gasket run-act -W .github/workflows/ci.yml # Run specific workflow
88
+ gasket run-act -s MY_SECRET=value # Pass secrets
89
+ gasket run-act -P ubuntu-latest=node:16-buster-slim # Platform override
90
+ ```
91
+
92
+ | Option | Type | Default | Description |
93
+ |--------|------|---------|-------------|
94
+ | `--event` / `-e` | Choice | `push` | Event type: `push`, `pull_request`, `workflow_dispatch`, `schedule`, `release` |
95
+ | `--workflow` / `-W` | Path | None | Specific workflow file or directory |
96
+ | `--job` / `-j` | String | None | Specific job name to run |
97
+ | `--secret` / `-s` | String | None | Secret in KEY=VALUE format (repeatable) |
98
+ | `--secret-file` | Path | None | Path to secrets file (.env format) |
99
+ | `--var` | String | None | Variable in KEY=VALUE format (repeatable) |
100
+ | `--var-file` | Path | None | Path to variables file |
101
+ | `--input` | String | None | Input in KEY=VALUE format for workflow_dispatch (repeatable) |
102
+ | `--input-file` | Path | None | Path to inputs file |
103
+ | `--event-file` | Path | None | Path to event JSON payload file |
104
+ | `--platform` / `-P` | String | None | Platform override RUNNER=IMAGE (repeatable) |
105
+ | `--env` | String | None | Environment variable KEY=VALUE (repeatable) |
106
+ | `--env-file` | Path | None | Path to env file |
107
+ | `--matrix` | String | None | Matrix filter KEY:VALUE (repeatable) |
108
+ | `--container-architecture` | String | None | Container architecture (e.g. `linux/amd64`) |
109
+ | `--artifact-server-path` | Path | None | Path to enable artifact server |
110
+ | `--dry-run` / `-n` | Flag | `False` | Dry run mode |
111
+ | `--list` / `-l` | Flag | `False` | List workflows without running |
112
+ | `--verbose` / `-v` | Flag | `False` | Verbose output |
113
+ | `--offline` | Flag | `False` | Use cached actions (offline mode) |
114
+ | `--timeout` | Integer | `600` | Timeout in seconds |
115
+
116
+ ### setup
117
+
118
+ Manage installation and prerequisites.
119
+
120
+ ```bash
121
+ gasket setup check # Check all prerequisites
122
+ gasket setup check --format json # JSON output
123
+ gasket setup install-act # Download and install act
124
+ gasket setup install-act --force # Force reinstall
125
+ gasket setup install-all # Install everything + verify
126
+ gasket setup uninstall-act # Remove act binary
127
+ ```
128
+
129
+ #### setup check
130
+
131
+ Check if Python, act, Docker, and Git are available.
132
+
133
+ #### setup install-act
134
+
135
+ Download the appropriate act binary for the current platform from GitHub releases.
136
+
137
+ | Option | Type | Description |
138
+ |--------|------|-------------|
139
+ | `--install-dir` | Path | Custom install directory |
140
+ | `--force` | Flag | Reinstall even if already installed |
141
+
142
+ #### setup install-all
143
+
144
+ Install all dependencies and verify the environment.
145
+
146
+ #### setup uninstall-act
147
+
148
+ Remove the act binary.
149
+
150
+ ## Exit Codes
151
+
152
+ | Code | Meaning |
153
+ |------|---------|
154
+ | `0` | Success |
155
+ | `1` | Execution error |
156
+ | `3` | act not found |
157
+
158
+ ## Testing
159
+
160
+ ```bash
161
+ # Run all tests
162
+ pytest
163
+
164
+ # Run with coverage
165
+ pytest --cov=gasket --cov-report=term-missing
166
+
167
+ # Run specific test file
168
+ pytest tests/test_run_act.py -v
169
+ ```
170
+
171
+ ## Project Structure
172
+
173
+ ```
174
+ gasket/
175
+ ├── pyproject.toml
176
+ ├── install.py # Standalone bootstrap installer
177
+ ├── src/
178
+ │ └── gasket/
179
+ │ ├── cli.py # Main CLI entry point (click.group)
180
+ │ ├── commands/
181
+ │ │ ├── run_act.py # run-act command
182
+ │ │ └── setup.py # setup command group
183
+ │ └── core/
184
+ │ ├── act_runner.py # act subprocess wrapper
185
+ │ └── act_installer.py # act binary downloader/installer
186
+ └── tests/
187
+ ├── test_run_act.py
188
+ └── test_setup.py
189
+ ```
190
+
191
+ ## License
192
+
193
+ MIT
@@ -0,0 +1,161 @@
1
+ # Gasket
2
+
3
+ A Python CLI tool that wraps [nektos/act](https://github.com/nektos/act) to run
4
+ GitHub Actions workflows locally via Docker.
5
+
6
+ Built with [Click](https://click.palletsprojects.com/) for composable commands.
7
+
8
+ ## Prerequisites
9
+
10
+ - **Python 3.10+**
11
+ - **Docker** - must be installed and running
12
+ - **nektos/act** - installed automatically via `gasket setup install-act`
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ # Clone the repository
18
+ git clone <repo-url>
19
+ cd gasket
20
+
21
+ # Create virtual environment
22
+ python -m venv .venv
23
+ source .venv/bin/activate # Linux/macOS
24
+ # .venv\Scripts\activate # Windows
25
+
26
+ # Install in development mode
27
+ pip install -e ".[dev]"
28
+
29
+ # Install act (if not already installed)
30
+ gasket setup install-act
31
+
32
+ # Verify installation
33
+ gasket --version
34
+ gasket --help
35
+ ```
36
+
37
+ Or use the standalone installer:
38
+
39
+ ```bash
40
+ python install.py
41
+ ```
42
+
43
+ ## Commands
44
+
45
+ ### run-act
46
+
47
+ Run GitHub Actions workflows locally using nektos/act.
48
+
49
+ ```bash
50
+ gasket run-act # Run push event workflows
51
+ gasket run-act --event pull_request # Run pull_request workflows
52
+ gasket run-act --list # List available workflows
53
+ gasket run-act --dry-run # Dry run only
54
+ gasket run-act -j test # Run specific job
55
+ gasket run-act -W .github/workflows/ci.yml # Run specific workflow
56
+ gasket run-act -s MY_SECRET=value # Pass secrets
57
+ gasket run-act -P ubuntu-latest=node:16-buster-slim # Platform override
58
+ ```
59
+
60
+ | Option | Type | Default | Description |
61
+ |--------|------|---------|-------------|
62
+ | `--event` / `-e` | Choice | `push` | Event type: `push`, `pull_request`, `workflow_dispatch`, `schedule`, `release` |
63
+ | `--workflow` / `-W` | Path | None | Specific workflow file or directory |
64
+ | `--job` / `-j` | String | None | Specific job name to run |
65
+ | `--secret` / `-s` | String | None | Secret in KEY=VALUE format (repeatable) |
66
+ | `--secret-file` | Path | None | Path to secrets file (.env format) |
67
+ | `--var` | String | None | Variable in KEY=VALUE format (repeatable) |
68
+ | `--var-file` | Path | None | Path to variables file |
69
+ | `--input` | String | None | Input in KEY=VALUE format for workflow_dispatch (repeatable) |
70
+ | `--input-file` | Path | None | Path to inputs file |
71
+ | `--event-file` | Path | None | Path to event JSON payload file |
72
+ | `--platform` / `-P` | String | None | Platform override RUNNER=IMAGE (repeatable) |
73
+ | `--env` | String | None | Environment variable KEY=VALUE (repeatable) |
74
+ | `--env-file` | Path | None | Path to env file |
75
+ | `--matrix` | String | None | Matrix filter KEY:VALUE (repeatable) |
76
+ | `--container-architecture` | String | None | Container architecture (e.g. `linux/amd64`) |
77
+ | `--artifact-server-path` | Path | None | Path to enable artifact server |
78
+ | `--dry-run` / `-n` | Flag | `False` | Dry run mode |
79
+ | `--list` / `-l` | Flag | `False` | List workflows without running |
80
+ | `--verbose` / `-v` | Flag | `False` | Verbose output |
81
+ | `--offline` | Flag | `False` | Use cached actions (offline mode) |
82
+ | `--timeout` | Integer | `600` | Timeout in seconds |
83
+
84
+ ### setup
85
+
86
+ Manage installation and prerequisites.
87
+
88
+ ```bash
89
+ gasket setup check # Check all prerequisites
90
+ gasket setup check --format json # JSON output
91
+ gasket setup install-act # Download and install act
92
+ gasket setup install-act --force # Force reinstall
93
+ gasket setup install-all # Install everything + verify
94
+ gasket setup uninstall-act # Remove act binary
95
+ ```
96
+
97
+ #### setup check
98
+
99
+ Check if Python, act, Docker, and Git are available.
100
+
101
+ #### setup install-act
102
+
103
+ Download the appropriate act binary for the current platform from GitHub releases.
104
+
105
+ | Option | Type | Description |
106
+ |--------|------|-------------|
107
+ | `--install-dir` | Path | Custom install directory |
108
+ | `--force` | Flag | Reinstall even if already installed |
109
+
110
+ #### setup install-all
111
+
112
+ Install all dependencies and verify the environment.
113
+
114
+ #### setup uninstall-act
115
+
116
+ Remove the act binary.
117
+
118
+ ## Exit Codes
119
+
120
+ | Code | Meaning |
121
+ |------|---------|
122
+ | `0` | Success |
123
+ | `1` | Execution error |
124
+ | `3` | act not found |
125
+
126
+ ## Testing
127
+
128
+ ```bash
129
+ # Run all tests
130
+ pytest
131
+
132
+ # Run with coverage
133
+ pytest --cov=gasket --cov-report=term-missing
134
+
135
+ # Run specific test file
136
+ pytest tests/test_run_act.py -v
137
+ ```
138
+
139
+ ## Project Structure
140
+
141
+ ```
142
+ gasket/
143
+ ├── pyproject.toml
144
+ ├── install.py # Standalone bootstrap installer
145
+ ├── src/
146
+ │ └── gasket/
147
+ │ ├── cli.py # Main CLI entry point (click.group)
148
+ │ ├── commands/
149
+ │ │ ├── run_act.py # run-act command
150
+ │ │ └── setup.py # setup command group
151
+ │ └── core/
152
+ │ ├── act_runner.py # act subprocess wrapper
153
+ │ └── act_installer.py # act binary downloader/installer
154
+ └── tests/
155
+ ├── test_run_act.py
156
+ └── test_setup.py
157
+ ```
158
+
159
+ ## License
160
+
161
+ MIT
@@ -0,0 +1,66 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "gasket-cli"
7
+ version = "0.1.0"
8
+ description = "Run GitHub Actions locally using nektos/act from a Python CLI"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ {name = "hieu_trincao", email = "kaiinredtie@gmail.com"},
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Environment :: Console",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Operating System :: OS Independent",
21
+ "Programming Language :: Python :: 3",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Topic :: Software Development :: Build Tools",
26
+ "Topic :: Software Development :: Testing",
27
+ ]
28
+ keywords = ["github-actions", "act", "ci", "local", "docker", "workflow"]
29
+ dependencies = [
30
+ "click>=8.0",
31
+ ]
32
+
33
+ [project.urls]
34
+ Homepage = "https://github.com/hieupham259/gasket"
35
+ Repository = "https://github.com/hieupham259/gasket"
36
+ Issues = "https://github.com/hieupham259/gasket/issues"
37
+
38
+ [project.optional-dependencies]
39
+ dev = [
40
+ "pytest>=7.0",
41
+ "pytest-cov>=4.0",
42
+ "mypy>=1.0",
43
+ "ruff>=0.1.0",
44
+ ]
45
+
46
+ [project.scripts]
47
+ gasket = "gasket.cli:cli"
48
+
49
+ [tool.setuptools.packages.find]
50
+ where = ["src"]
51
+
52
+ [tool.pytest.ini_options]
53
+ testpaths = ["tests"]
54
+ addopts = "-v --tb=short"
55
+
56
+ [tool.ruff]
57
+ target-version = "py310"
58
+ line-length = 100
59
+
60
+ [tool.ruff.lint]
61
+ select = ["E", "F", "W", "I", "N", "UP", "B", "SIM"]
62
+
63
+ [tool.mypy]
64
+ python_version = "3.10"
65
+ warn_return_any = true
66
+ warn_unused_configs = true
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ """Gasket - Run GitHub Actions locally using nektos/act."""
2
+
3
+ from __future__ import annotations
4
+
5
+ __version__ = "0.1.0"
@@ -0,0 +1,23 @@
1
+ """Main CLI entry point for gasket."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import click
6
+
7
+ from gasket.commands.run_act import run_act_command
8
+ from gasket.commands.setup import setup
9
+
10
+
11
+ @click.group()
12
+ @click.version_option(package_name="gasket", prog_name="gasket")
13
+ def cli() -> None:
14
+ """Gasket - Run GitHub Actions locally using nektos/act.
15
+
16
+ A Python CLI tool that wraps nektos/act to execute GitHub Actions
17
+ workflows locally via Docker.
18
+ """
19
+ pass
20
+
21
+
22
+ cli.add_command(run_act_command)
23
+ cli.add_command(setup)
@@ -0,0 +1 @@
1
+ """CLI command modules for gasket."""