Skip to content

Commit

Permalink
Fix: issue #46 remove ".devcontainer" (#47)
Browse files Browse the repository at this point in the history
* fix: issue #46 - remove ".devcontainer"

* fix: remove redundant test and containers using ".devcontainer"
  • Loading branch information
KEINOS authored Nov 7, 2022
1 parent 9b0e6cd commit ef0fad4
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 271 deletions.
19 changes: 0 additions & 19 deletions .devcontainer/Dockerfile

This file was deleted.

22 changes: 0 additions & 22 deletions .devcontainer/README.md

This file was deleted.

50 changes: 0 additions & 50 deletions .devcontainer/devcontainer.json

This file was deleted.

10 changes: 0 additions & 10 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,6 @@ services:
volumes:
- ..:/workspaces
entrypoint: [ "./.github/run-tests-go-install.sh" ]
# Service mergeability runs all the tests to be merged.
mergeability:
build:
context: ..
dockerfile: ./.devcontainer/Dockerfile
args:
VARIANT: latest
volumes:
- ..:/workspaces
entrypoint: [ "./.github/run-tests-merge.sh" ]
# Service linuxbrew simply downloads and test-run the released binary via brew.
linuxbrew:
image: homebrew/brew
Expand Down
155 changes: 0 additions & 155 deletions .github/run-tests-merge.sh

This file was deleted.

5 changes: 0 additions & 5 deletions .github/workflows/version-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ jobs:
docker load --input ${{ env.PATH_CACHE }}/github_v1_17_1.tar
docker load --input ${{ env.PATH_CACHE }}/github_v1_18_1.tar
docker load --input ${{ env.PATH_CACHE }}/github_latest_1.tar
docker load --input ${{ env.PATH_CACHE }}/github_mergeability_1.tar
- name: Build Docker images if no-exists
if: steps.cache.outputs.cache-hit != 'true'
Expand All @@ -58,7 +57,6 @@ jobs:
docker pull golang:1.17-alpine
docker pull golang:1.18-alpine
docker pull golang:alpine
docker pull ghcr.io/keinos/vscode-dev-container-go:latest
: # Build container images
docker-compose --file ./.github/docker-compose.yml build
Expand All @@ -73,7 +71,6 @@ jobs:
docker save --output ${{ env.PATH_CACHE }}/github_v1_17_1.tar github_v1_17:latest
docker save --output ${{ env.PATH_CACHE }}/github_v1_18_1.tar github_v1_18:latest
docker save --output ${{ env.PATH_CACHE }}/github_latest_1.tar github_latest:latest
docker save --output ${{ env.PATH_CACHE }}/github_mergeability_1.tar github_mergeability:latest
- name: Run tests on Go 1.15
run: docker-compose --file ./.github/docker-compose.yml run v1_15
Expand All @@ -85,5 +82,3 @@ jobs:
run: docker-compose --file ./.github/docker-compose.yml run v1_18
- name: Run tests on latest Go
run: docker-compose --file ./.github/docker-compose.yml run latest
- name: Run tests for mergeability
run: docker-compose --file ./.github/docker-compose.yml run mergeability
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
<!-- markdownlint-disable MD001 MD041 -->
[![go1.15+](https://img.shields.io/badge/Go-1.15,%2016,%2017,%20latest-blue?logo=go)](https://github.com/KEINOS/dev-go/actions/workflows/go-versions.yml "Supported versions")
[![go1.15+](https://img.shields.io/badge/Go-1.15,%2016,%2017,%2018,%20latest-blue?logo=go)](https://github.com/KEINOS/dev-go/actions/workflows/go-versions.yml "Supported versions")
[![Go Reference](https://pkg.go.dev/badge/github.com/KEINOS/Hello-Cobra.svg)](https://pkg.go.dev/github.com/KEINOS/Hello-Cobra#section-documentation "Read generated documentation of the app")

# "Hello, world!" example of Cobra with 100% code coverage

> __Note__ : "`Cobra`" is an awesome framework of Go to help create CLI apps.
**This repo is an example of [Cobra](https://cobra.dev/)'s "`Hello, world!`" with 100% code coverage**.
__This repo is an example of [Cobra](https://cobra.dev/)'s "`Hello, world!`" with 100% code coverage__.

Including the below to just say "Hello" to the world!

- [CI](./github/workflows/)
- Unit tests on Go v1.15 to the latest.
- Static analysis, security scan, lint and format check.
- Monthly vulnerability scan via CodeQL.
- Automated monthly update of `go.mod` and `go.sum` on test-pass.
- Unit tests on Go v1.15 to the latest.
- Static analysis, security scan, lint and format check.
- Monthly vulnerability scan via CodeQL.
- Automated monthly update of `go.mod` and `go.sum` on test-pass.
- Automated [Homebrew release](https://github.com/KEINOS/homebrew-Hello-Cobra) on release push.

## Searching for the best practices of Cobra

**We all know keeping 100% of code coverage is a myth.** But as a `Golang` and `Cobra` beginner, we wanted a "Hello-world" example with 100% of coverage, which couldn't be found by _googling_ for "[`golang` `cobra` `sample` `example` `hello` `world` `coverage` `100%`](https://www.google.com/search?q=%22golang%22+cobra+sample+example+hello+world+coverage+100%)".
__We all know keeping 100% of code coverage is a myth__. But as a `Golang` and `Cobra` beginner, we wanted a "Hello-world" example with 100% of coverage, which couldn't be found by _googling_ for "[`golang` `cobra` `sample` `example` `hello` `world` `coverage` `100%`](https://www.google.com/search?q=%22golang%22+cobra+sample+example+hello+world+coverage+100%)".

This repo aims to find the best-practices of `Cobra` by refactoring it on a moment-to-moment basis. But keeping the code coverage as high as possible and less complexity as possible.

- Therefore, this is a forever-[WIP](https://en.wikipedia.org/wiki/Work_in_progress)-repo.<br>So any PR for the better is welcome!! We will merge it as long as it passess the tests with 100% coverage and not a prank-kind PR.
- Therefore, this is a forever-[WIP](https://en.wikipedia.org/wiki/Work_in_progress)-repo.
So any [PR](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) for the better is welcome!! We will merge it as long as it passess the tests with 100% coverage and not a prank-kind PR.
- Branch to PR: `main`

## Statuses

Expand All @@ -37,9 +39,11 @@ This repo aims to find the best-practices of `Cobra` by refactoring it on a mome
## Note

- This example app supports Homebrew installation. To know how it works see: [.goreleaser.yml](./.goreleaser.yml)

```bash
brew install KEINOS/Hello-Cobra/hello-cobra
```

```shellsession
$ brew install KEINOS/Hello-Cobra/hello-cobra
==> Tapping keinos/hello-cobra
Expand All @@ -56,23 +60,25 @@ This repo aims to find the best-practices of `Cobra` by refactoring it on a mome
$ hello-cobra hello foo bar --reverse
!rab dna oof ,olleH
```

- This package auto-detects the app version from the `git` tag if the app was installed via `go install` (on Go v1.16+) or `go get -u` (on Go 1.15). Try:

```bash
# For Go 1.16 or above
cd /tmp
go install "github.com/KEINOS/Hello-Cobra/hello-cobra@latest"
hello-cobra --version
# Output: hello-cobra version v1.3.0
```

```bash
# For Go 1.15
cd /tmp
GO111MODULE="on" go get -u "github.com/KEINOS/Hello-Cobra/hello-cobra@latest"
hello-cobra --version
# Output: hello-cobra version v1.3.0
```
- This repo is [GitHub Codespaces](https://github.com/features/codespaces) compatible. Press the `.`(dot) key to open VSCode online. (You may need to register to use Codespaces)
- This repo is [VS Code + Docker](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack) compatible as well. See the [./.devcontainer/README.md](./.devcontainer/README.md) for more details.

- This repo updates monthly the `go.mod` and `go.sum` files if all the tests succeeds to run in all Go versions (Go v1.15~latest).

## License
Expand Down

0 comments on commit ef0fad4

Please sign in to comment.