Skip to content

Commit c7bfe7e

Browse files
authored
FEAT: Integrated CLI (#1)
* feat: add CLI scaffold * fix: tests * fix: separate build-info package * fix: improve config loading * ci: add build * fix: build from default fallback * feat: add test command * test: coverage * fix: test for env utils * feat: add dockerized integration test * feat: add doctor command * fix: isolate env for tests * fix: add more go pre-commit checks * ci: add missing setup for pre-commit tools * ci: consolidate jobs * ci: add job names * chore: release notes
1 parent 176aadd commit c7bfe7e

55 files changed

Lines changed: 4570 additions & 212 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
---
2-
name: "Setup Python Workspace"
3-
description: "Configure Python tools with UV"
2+
name: "Setup Go Workspace"
3+
description: "Configure Go and prepare the workspace"
44

55
runs:
66
using: composite
77
steps:
8-
- name: Install uv
9-
uses: astral-sh/setup-uv@v6
10-
11-
- name: Set up Python
12-
uses: actions/setup-python@v5
8+
- name: Set up Golang
9+
uses: actions/setup-go@v5
1310
with:
14-
python-version-file: "pyproject.toml"
15-
16-
- name: Install requirements
17-
shell: bash
18-
run: uv sync --locked --all-extras --dev
11+
go-version: "1.24"
1912

2013
- name: Install Just
2114
uses: extractions/setup-just@v2
15+
16+
- name: Install Go modules
17+
shell: bash
18+
run: |
19+
just tidy

.github/pull_request_template.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# DEVOPS: PULL REQUEST
2+
3+
## Description
4+
5+
<!-- High level description or summary of the PR -->
6+
7+
### Changes
8+
9+
<!-- List of changes -->
10+
11+
- _Type your changes here_
12+
- _Type your changes here_
13+
14+
## Testing
15+
16+
<!-- This section explains to users how to test the changes on their local machine -->
17+
18+
## Future Work
19+
20+
<!-- Optional -->
21+
<!-- Add any future work plans that are not addressed by the PR but are raised by the PR -->
22+
23+
## Discussion Points
24+
25+
<!-- Optional -->
26+
<!-- Points that need further discussion with the PR reviewers or other team members -->

.github/release/v0.0.3.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# 🚀 New Release: `devops` v0.0.3
2+
3+
We’re excited to announce the first beta release of **`devops`** CLI, a fast and flexible command-line
4+
tool designed to streamline your developer workflow.
5+
6+
## ✨ Highlights
7+
8+
- **Task Runner** – Define and execute devops tasks from a simple YAML spec.
9+
- **Config Management** – Store project configurations in `devops-definition.yaml`.
10+
- **Verbosity Control** – Adjustable logging levels (`-v`, `-vv`, `-vvv`) for better debugging.
11+
12+
## 📦 Installation
13+
14+
To get started, install the CLI using the following command:
15+
16+
```bash
17+
go install github.com/jgfranco17/devops@latest
18+
```
19+
20+
## 🔧 Usage
21+
22+
```bash
23+
devops --help
24+
```
25+
26+
## 📄 License
27+
28+
This project is licensed under the MIT License.
29+
See the [LICENSE](https://github.com/jgfranco17/devops/blob/main/LICENSE) file for more details.

.github/workflows/cicd.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: Main Pipeline
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
lint:
14+
name: Run linters
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup workspace
22+
uses: ./.github/actions/setup-workspace
23+
24+
- name: Install linters
25+
run: |
26+
pip install --upgrade pip
27+
pip install pre-commit==3.5.0
28+
29+
- name: Install dependencies
30+
run: |
31+
just tidy
32+
go install golang.org/x/tools/cmd/goimports@latest
33+
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
34+
35+
- name: Run linters
36+
run: pre-commit run --all-files
37+
38+
test:
39+
name: Run unit tests
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
45+
- name: Run setup
46+
uses: ./.github/actions/setup-workspace
47+
48+
- name: Run tests
49+
run: |
50+
go clean -testcache
51+
go test -v -cover -race ./...
52+
53+
build:
54+
name: Build
55+
runs-on: ubuntu-latest
56+
needs: test
57+
steps:
58+
- name: Checkout repository
59+
uses: actions/checkout@v4
60+
61+
- name: Run setup
62+
uses: ./.github/actions/setup-workspace
63+
64+
- name: Build binary
65+
run: |
66+
just tidy
67+
just build
68+
69+
- name: Run binary
70+
run: |
71+
./devops --help
72+
73+
- name: Upload binary
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: devops-linux-amd64
77+
path: ./devops
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Integration Test
3+
"on":
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
12+
permissions:
13+
id-token: write
14+
contents: read
15+
16+
jobs:
17+
integration-test:
18+
name: Run integration tests
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Install Just
25+
uses: ./.github/actions/setup-workspace
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Run integration tests
31+
working-directory: ./integration
32+
run: |
33+
just build
34+
just test-all

.github/workflows/pre-commit.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,27 @@ permissions:
1616
pull-requests: read
1717

1818
jobs:
19+
verify:
20+
name: Verify release
21+
runs-on: ubuntu-latest
22+
if: ${{ !contains(github.event.head_commit.message, '[skip release]') }}
23+
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v4
27+
28+
- name: Setup workspace
29+
uses: ./.github/actions/setup-workspace
30+
31+
- name: Run pre-release checks
32+
run: |
33+
go mod verify
34+
go test -v -cover -race ./...
35+
1936
release:
37+
name: Create release
2038
runs-on: ubuntu-latest
39+
needs: verify
2140
if: ${{ !contains(github.event.head_commit.message, '[skip release]') }}
2241

2342
steps:

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ htmlcov/
2020
.idea
2121
.DS_Store
2222
node_modules
23+
devops
24+
25+
# Go workspace
26+
go.work
27+
go.work.sum

.markdownlint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
MD013: { line_length: 100 }
3+
MD033: false
4+
MD036: false

.pre-commit-config.yaml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,23 @@ repos:
1212
- id: check-merge-conflict
1313
- id: detect-private-key
1414

15-
- repo: https://github.com/astral-sh/uv-pre-commit
16-
rev: 0.8.22
15+
# Enforce conventional commits
16+
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
17+
rev: v9.0.0
1718
hooks:
18-
- id: uv-lock
19+
- id: commitlint
20+
stages: [commit-msg]
21+
additional_dependencies: ["@commitlint/config-conventional@16.2.1"]
22+
23+
# Go standards and linting
24+
- repo: https://github.com/dnephin/pre-commit-golang
25+
rev: v0.5.1
26+
hooks:
27+
- id: go-fmt
28+
- id: go-vet
29+
- id: go-imports
30+
- id: go-cyclo
31+
- id: go-unit-tests
1932

2033
- repo: https://github.com/codespell-project/codespell.git
2134
rev: v2.4.1
@@ -32,24 +45,11 @@ repos:
3245
stages: [pre-commit]
3346
exclude: Pipfile.lock
3447

35-
- repo: https://github.com/pycqa/isort
36-
rev: 6.0.1
37-
hooks:
38-
- id: isort
39-
args: ["--profile", "black", "--skip-glob", "/builds/*"]
40-
41-
# Python code formatting
42-
- repo: https://github.com/psf/black
43-
rev: 25.9.0
44-
hooks:
45-
- id: black
46-
47-
# Python code formatting in code blocks inside docs
48-
- repo: https://github.com/asottile/blacken-docs
49-
rev: 1.20.0
48+
- repo: https://github.com/igorshubovych/markdownlint-cli
49+
rev: v0.45.0
5050
hooks:
51-
- id: blacken-docs
52-
additional_dependencies: [black==22.3.0]
51+
- id: markdownlint
52+
args: [--config, ".markdownlint.yaml"]
5353

5454
# Security
5555
- repo: https://github.com/Yelp/detect-secrets

0 commit comments

Comments
 (0)