Skip to content

Commit

Permalink
chore: Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KEINOS committed Nov 30, 2021
1 parent 501e031 commit d4f4e9f
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/check-requirements.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# =============================================================================
# This script checks if the commands and packages required for merge testing
# are installed.
# are installed. Run this script before running ./run-tests-merge.sh.
# =============================================================================

# -----------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/codeQL-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
name: "CodeQL"

on:
push:
workflow_dispatch:
pull_request:
branches:
- main
schedule:
# Runs at 16:30 UTC on day-of-month 1 (Every day-of-month 1 at AM 01:30 JST, my time)
# See: https://crontab.guru/
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/coverage-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ name: 100% Coverage

on:
workflow_dispatch:
push:
pull_request:
branches:
- main

env:
PATH_CACHE: /tmp/docker-img-arch
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ name: golangci-lint

on:
workflow_dispatch:
push:
pull_request:
branches:
- main

jobs:
golangci:
Expand All @@ -16,15 +18,4 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: latest

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
args: --config ./.golangci.yml

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true

# Optional: if set to true then the action will use pre-installed Go
# skip-go-installation: true
4 changes: 3 additions & 1 deletion .github/workflows/platform-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ name: Test on macOS/Win/Linux

on:
workflow_dispatch:
push:
pull_request:
branches:
- main

jobs:
coverage:
Expand Down
26 changes: 11 additions & 15 deletions .github/workflows/release_bin.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# This workflow will release the built binaries for Linux, macOS and Windows.
# =============================================================================
# Release Assets and Homebrew's Tap
# =============================================================================
# This workflow will build the binaries and push the archives to the assets in
# the releases page if a release was created. Then pushes the tap config file
# for Homebrew tap. See: ../../.goreleaser.yml
name: Release

on:
workflow_dispatch:
release:
types:
- created
tags:
- 'v*'
- 'v*'
jobs:
goreleaser:
runs-on: ubuntu-latest
Expand All @@ -14,24 +21,13 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run tests
run: docker-compose --file ./.github/docker-compose.yml up mergeability
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.17.x'
- name: Download mods
run: go mod download
# Wait until the unit test (version-tests.yaml) finishes
- name: Wait Tests
id: test_result
uses: Sibz/[email protected]
with:
contexts: test-status
authToken: ${{ secrets.GITHUB_TOKEN }}
timeout: 30
# Push the built assets to the release page and push Homebrew config file
# to https://github.com/EINOS/homebrew-Hello-Cobra repo.
- name: Run GoReleaser
if: steps.test_result.outputs.result != 'success'
uses: goreleaser/goreleaser-action@v2
with:
version: latest
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/update-codecov.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Workflow to updates the coverage for CodeCov.io on release.
# =============================================================================
# Update CodeCov
# =============================================================================
# This Workflow to updates the coverage to CodeCov.io on release.
name: Update codecov.io

on:
Expand All @@ -7,8 +10,7 @@ on:
types:
- created
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- '**/v[0-9]+.[0-9]+.[0-9]+'
- 'v*'

jobs:
build:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/update-mod-monthly.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# =============================================================================
# Weekly Module Update
# =============================================================================
# This workflow runs monthly to update and test the latest `go.mod` version and
# `go install` (or `go get -u`) functionality.
#
# If all the tests succeeds to run in all Go versions, it will create a new PR
# of the `go.mod` and `go.sum`.
# This workflow runs monthly to:
# 1. Update the `go.mod` and `go.sum` files if all the tests succeeds to run
# in all Go versions with that updated versions. (Go v1.15~latest)
# 2. Test `go get -u` and `go install` functionality of the latest release.
# 3. Pull request the updated `go.mod` and `go.sum`
#
# NOTE:
# You need to set the repository secreat of `PERSONAL_ACCESS_TOKEN` environment
# variable in your repo's:
# You need to set the "PERSONAL_ACCESS_TOKEN" env variable in the repository
# secreat of your repo at:
# [Settings]-[Secrets]-[Actions secrets]
# To generate a new token go to:
# https://github.com/settings/tokens
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/version-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Workflow for various Go versions over Docker on any push to main.
# =============================================================================
# Unit Tests on Go v1.15, 16, 17 and latest
# =============================================================================
# This Workflow runs unit tests on various Go versions over Docker on any push.
# This action caches the built Docker image for a day unless any change in the
# Dockerfile was made.
name: Go 1.15~latest
Expand Down Expand Up @@ -80,16 +83,3 @@ jobs:
run: docker-compose --file ./.github/docker-compose.yml up latest
- name: Run tests for mergeability
run: docker-compose --file ./.github/docker-compose.yml up mergeability
# If the "go" job suceeds then flag up the finish status as 'success' of this action
# to annouce the other actions. See: release_bin.yaml
test-status:
name: Test status
runs-on: ubuntu-latest
needs: go
steps:
- name: Set Check Status Success
uses: Sibz/[email protected]
with:
context: test-status
authToken: ${{ secrets.GITHUB_TOKEN }}
state: success
2 changes: 2 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# =============================================================================
# Configuration for `goreleaser`.
# =============================================================================
# What It Is
#
# This is a configuration file for `goreleaser` command to "automate" releasing
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ This repo aims to find the best-practices of `Cobra` by refactoring it on a mome
$ hello-cobra --version
hello-cobra version 1.3.2-alpha (c3c9eab)
$ hello-cobra hello-cobra hello foo bar
$ hello-cobra hello foo bar
Hello, foo and bar!
$ hello-cobra hello foo bar --reverse
Expand Down

0 comments on commit d4f4e9f

Please sign in to comment.