Skip to content

Commit

Permalink
feat: Godocmd action added for updating readme automatically. (TheAlg…
Browse files Browse the repository at this point in the history
…orithms#429)

* workflow

* fix: workflow

* feat: workflow

* Updated README.md

* Update README.md

* Updated README.md

* Update generate_readme.yml

* Update generate_readme.yml

* Updated Documentation in README.md

* Update generate_readme.yml

* Updated Documentation in README.md

* Update README.md

* Updated Documentation in README.md

* Update generate_readme.yml

* Updated Documentation in README.md

* Update README.md

* Updated Documentation in README.md

* fix: package level documentation

* Updated Documentation in README.md

* fix: incorrect package level documentation

* Updated Documentation in README.md

* Update README.md

* Updated Documentation in README.md

* Update decimaltobinary.go

* Updated Documentation in README.md

* fix: incorrect documentation format

* Updated Documentation in README.md

* fix: documentation format

* Updated Documentation in README.md

* fix: documentation format

* Updated Documentation in README.md

* fix: documentation

* Updated Documentation in README.md

* fix: documentation

* Updated Documentation in README.md

* Update generate_readme.yml

* Update golang_lint_and_test.yml

* Update generate_readme.yml

* Update generate_readme.yml

* fix: documentation

* fix: godocmd badge

* Update README.md

* Update godocmd.yml

* Updated Documentation in README.md

Co-authored-by: godocmd-action <${GITHUB_ACTOR}@users.noreply.github.com>
  • Loading branch information
tjgurwara99 and godocmd-action authored Nov 9, 2021
1 parent 7ccc45e commit ec28323
Show file tree
Hide file tree
Showing 11 changed files with 870 additions and 120 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/godocmd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: godocmd
on: [push, pull_request]
jobs:
generate_readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: '^1.17'
- name: Install GoDocMD
run: |
go install github.com/tjgurwara99/[email protected]
- name: Configure Github Action
run: |
git config --global user.name github-action
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
- name: Update README.md file
run: |
godocmd -r -module ./ -w
- name: Commit changes if README.md is different
run: |
if [[ `git status --porcelain` ]]; then
git commit -am "Updated Documentation in README.md"
git push
else
echo "NO CHANGES DETECTED"
fi
13 changes: 8 additions & 5 deletions .github/workflows/golang_lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: codespell-project/actions-codespell@master
- name: Codespell
uses: codespell-project/actions-codespell@master
with:
ignore_words_list: "actualy,nwe"
skip: "go.mod,go.sum"
- uses: actions/setup-go@v2
- run: go version
- uses: golangci/golangci-lint-action@v2
- name: Setup Go
uses: actions/setup-go@v2
- name: Run Golang CI Lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
args: -E gofmt
- run: go test ./...
- name: Run tests
run: go test ./...
934 changes: 829 additions & 105 deletions README.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion conversion/binarytodecimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Date: 19-Oct-2021
// Function receives a Binary Number as string and returns the Decimal number as integer.
// Supported Binary number range is 0 to 2^(31-1).

// Package name.
package conversion

// Importing necessary package.
Expand Down
1 change: 0 additions & 1 deletion conversion/decimaltobinary.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Date: 14-Oct-2021
// Function receives a integer as a Decimal number and returns the Binary number.
// Supported integer value range is 0 to 2^(31 -1).

// Package name.
package conversion

// Importing necessary package.
Expand Down
1 change: 1 addition & 0 deletions graph/bellmanford.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// It is slower than Dijkstra but capable of handling negative edge weights.
// https://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm
// Implementation is based on the book 'Introduction to Algorithms' (CLRS)

package graph

import (
Expand Down
1 change: 1 addition & 0 deletions math/binary/xorsearch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// description: Test for Find a missing number in a sequence
// author(s) [red_byte](https://github.com/i-redbyte)
// see xorsearch.go

package binary

import (
Expand Down
1 change: 0 additions & 1 deletion sort/countingsort.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// author [Phil](https://github.com/pschik)
// see sort_test.go for a test implementation, test function TestQuickSort

// package sort provides primitives for sorting slices and user-defined collections
package sort

func Count(data []int) []int {
Expand Down
3 changes: 3 additions & 0 deletions structure/set/set.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// package set implements a Set using a golang map.
// This implies that only the types that are accepted as valid map keys can be used as set elements.
// For instance, do not try to Add a slice, or the program will panic.
package set

// New gives new set.
Expand Down
3 changes: 0 additions & 3 deletions structure/set/set_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// package set implements a Set using a golang map.
// This implies that only the types that are accepted as valid map keys can be used as set elements.
// For instance, do not try to Add a slice, or the program will panic.
package set

import (
Expand Down
4 changes: 0 additions & 4 deletions structure/set/setexample_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// package set implements a Set using a golang map.
// This implies that only the types that are accepted as valid map keys can be used as set elements.
// For instance, do not try to Add a slice, or the program will panic.
//
package set

import (
Expand Down

0 comments on commit ec28323

Please sign in to comment.