Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Refine README.md #46

Merged
merged 51 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
e39f670
docs: positioning the project as get started guidelines for people wh…
riandyrn Jul 15, 2023
39e99f6
chore: run go mod tidy;
riandyrn Jul 15, 2023
094cd02
Revert "chore: run go mod tidy;"
riandyrn Jul 15, 2023
6dd3ce8
Merge branch 'master' into docs/refine-readme
riandyrn Jul 15, 2023
0474ce8
docs: refine background why we have this repo;
riandyrn Jul 15, 2023
e3e3b74
chore: generate test coverage rate during testing to adhere with requ…
riandyrn Jul 16, 2023
7ef6e7a
chore: execute `make test` immediately in deploy.yml workflow;
riandyrn Jul 16, 2023
bcf23d0
chore: rename tests.yml into ci.yml; add coverage badge to README.md …
riandyrn Jul 16, 2023
594ced4
chore: add test trigger;
riandyrn Jul 16, 2023
4013053
chore: fix coverage.out path;
riandyrn Jul 16, 2023
2ba595f
chore: remove test trigger from deploy.yml; fix incorrect path for co…
riandyrn Jul 16, 2023
6117de2
chore: try to fix ci.yml by following example found in https://github…
riandyrn Jul 16, 2023
172652c
Merge 6117de2b9cc9e786df5c2aa6994b040b1955ab00 into 0474ce87201f8aa33…
riandyrn Jul 16, 2023
b228333
chore: updated test coverage badge
actions-user Jul 16, 2023
c3ee707
chore: use GOBadge instead tj-actions to make it more flexible for us…
riandyrn Jul 16, 2023
2b3715b
chore: fix label parameter for go badge; link the coverage badge to t…
riandyrn Jul 16, 2023
e41607a
chore: fix missing GH_TOKEN for github CLI;
riandyrn Jul 16, 2023
635b6da
Merge e41607aa64c6c9913757a9786e745e0124632032 into 0474ce87201f8aa33…
riandyrn Jul 16, 2023
f49a976
chore: updated test coverage badge
actions-user Jul 16, 2023
696eaa8
docs: fix coverage badge position in README.md;
riandyrn Jul 16, 2023
8f00094
Merge 696eaa8eb53827b726b091238e45c9dfb4d615a9 into 0474ce87201f8aa33…
riandyrn Jul 16, 2023
789e5f2
chore: updated test coverage badge
actions-user Jul 16, 2023
c418ea7
chore: extrapolate badge target url rather than using github CLI; set…
riandyrn Jul 16, 2023
d9eb755
core: revert back brach value;
riandyrn Jul 16, 2023
ef65778
Merge d9eb755bfa92cae949df29d4613250f14c81c310 into 0474ce87201f8aa33…
riandyrn Jul 16, 2023
2324849
chore: updated test coverage badge
actions-user Jul 16, 2023
3530a7c
chore: try to use example workflow from awesome-go; disable build job…
riandyrn Jul 16, 2023
3967416
chore: apply code coverage badge
riandyrn Jul 16, 2023
5f79e02
chore: remove unneeded push step;
riandyrn Jul 16, 2023
8c7e15f
chore: apply code coverage badge
riandyrn Jul 16, 2023
b96346c
docs: add simple-game information into README to get more interest
harunalfat Jul 16, 2023
5148752
chore: update version of actions/checkout to v3; rename .tmp folder t…
riandyrn Jul 16, 2023
8bad966
docs: describe more about the benefit of our architecture
harunalfat Jul 16, 2023
0eeeb8d
chore: keep coverage.out; update ci.yaml;
riandyrn Jul 16, 2023
e46c6be
Merge branch 'docs/refine-readme' into chore/adhere-to-awesome-go-gui…
riandyrn Jul 16, 2023
95ad7da
chore: update coverage report & apply code coverage badge to README.md
riandyrn Jul 16, 2023
005327b
chore: separate between CI pipeline & generate coverage badge pipelin…
riandyrn Jul 16, 2023
298ae6c
chore: delete test triggers in all workflow files;
riandyrn Jul 16, 2023
72969bb
Merge pull request #48 from Haraj-backend/chore/adhere-to-awesome-go-…
riandyrn Jul 16, 2023
977e59b
docs: proofread README.md;
riandyrn Jul 17, 2023
e13950a
docs: proofread README.md;
riandyrn Jul 17, 2023
337b094
docs: proofread background story in README.md;
riandyrn Jul 17, 2023
7924db9
chore: make ci.yaml to ignore changes on docs;
riandyrn Jul 17, 2023
bebb2d6
docs: proofread README.md;
riandyrn Jul 17, 2023
eb1663a
docs: proofread README.md;
riandyrn Jul 17, 2023
e06f3dc
docs: proofread background story of hex-architecture;
riandyrn Jul 17, 2023
7b0c5be
docs: proofread conclusion & relation with ddd section in hex-archite…
riandyrn Jul 17, 2023
daeb0a3
docs: proofread README.md;
riandyrn Jul 17, 2023
e2ab051
docs: proofread README.md;
riandyrn Jul 17, 2023
88dce03
docs: add Haraj link to README.md;
riandyrn Jul 17, 2023
4189a9f
chore: fix naming determine changes in ci.yml; remove notify to slack…
riandyrn Jul 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: ci

on:
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'

jobs:
preparation:
name: Prepare Deployment
runs-on: ubuntu-latest
outputs:
exec-tests: ${{ (steps.changes.outputs.exec-tests == 'true') }}
steps:
- name: Checkout Current Commit
uses: actions/checkout@v3

- name: Determine Changes
uses: dorny/paths-filter@v2
id: changes
with:
base: ${{ github.ref }}
filters: |
exec-tests:
- ".github/workflows/**"
- "internal/**"
- "build/**"
- "cmd/**"
- "deploy/**"
- "go.mod"
- "go.sum"
- "Makefile"

- name: Notify To Slack If Failed
uses: lazy-actions/[email protected]
if: failure()
with:
type: ${{ job.status }}
job_name: "*[hex-monscape]* ${{ github.job }}"
mention: "here"
mention_if: "failure"
channel: "#solutions-team-ci-cd"
icon_emoji: ":haraaj:"
username: "ci/cd-reporter"
url: ${{ secrets.SOLUTIONS_TEAM_SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}

build-all:
name: Test Build All Container Images
needs: preparation
if: needs.preparation.outputs.exec-tests == 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout Current Commit
uses: actions/checkout@v3

- name: Run Build All
run: make test-build-all

- name: Notify To Slack If Failed
uses: lazy-actions/[email protected]
if: failure()
with:
type: ${{ job.status }}
job_name: "*[hex-monscape]* ${{ github.job }}"
mention: "here"
mention_if: "failure"
channel: "#solutions-team-ci-cd"
icon_emoji: ":haraaj:"
username: "ci/cd-reporter"
url: ${{ secrets.SOLUTIONS_TEAM_SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}

run-tests:
name: Run Automated Tests
needs: preparation
if: needs.preparation.outputs.exec-tests == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Current Commit
uses: actions/checkout@v3

- name: Run Automated Tests
run: make test

- name: Notify To Slack If Failed
uses: lazy-actions/[email protected]
if: failure()
with:
type: ${{ job.status }}
job_name: "*[hex-monscape]* ${{ github.job }}"
mention: "here"
mention_if: "failure"
channel: "#solutions-team-ci-cd"
icon_emoji: ":haraaj:"
username: "ci/cd-reporter"
url: ${{ secrets.SOLUTIONS_TEAM_SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
61 changes: 61 additions & 0 deletions .github/workflows/coverage-badge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: coverage-badge

on:
push:
paths-ignore:
- 'Makefile'
- '**.md'
- 'docs/**'
branches:
- master

jobs:
gen-badge:
name: Generate Coverage Badge
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Current Commit
uses: actions/checkout@v3

- name: Generate Coverage Report
run: make test

- name: Install Go
uses: actions/[email protected]

- name: Install gobadge
run: go install github.com/AlexBeauchemin/gobadge@latest

- name: Generate Coverage Badge
run: |
# generate coverage badge
gobadge \
-filename=./.output/cov-report/coverage.out \
-green=80 \
-target=README.md \
-text=coverage \
-link=./.output/cov-report/coverage.out

- name: Auto Commit & Push Coverage Badge
uses: stefanzweifel/git-auto-commit-action@v4
id: auto-commit-action
with:
commit_message: "chore: update coverage report & apply coverage badge to README.md"
file_pattern: 'README.md .output/cov-report/coverage.out'

- name: Notify To Slack If Failed
uses: lazy-actions/[email protected]
if: failure()
with:
type: ${{ job.status }}
job_name: "*[hex-monscape]* ${{ github.job }}"
mention: "here"
mention_if: "failure"
channel: "#solutions-team-ci-cd"
icon_emoji: ":haraaj:"
username: "ci/cd-reporter"
url: ${{ secrets.SOLUTIONS_TEAM_SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
44 changes: 26 additions & 18 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build & Deploy
name: deploy

on:
push:
Expand All @@ -10,43 +10,51 @@ on:
- master

jobs:
run-test:
uses: ./.github/workflows/tests.yml
name: Run Tests
with:
checkout-ref: ${{ github.sha }}
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
SOLUTIONS_TEAM_SLACK_WEBHOOK: ${{ secrets.SOLUTIONS_TEAM_SLACK_WEBHOOK }}

preparation:
name: Prepare Environment
needs: run-test
name: Prepare Deployment
runs-on: ubuntu-latest
outputs:
deploy-game: ${{ (steps.changes.outputs.lambda == 'true') || (steps.changes.outputs.all == 'true') }}
deploy-game: ${{ (steps.changes.outputs.deploy-game == 'true') }}
steps:
- name: Checkout Latest Commit
uses: actions/checkout@v2
- name: Checkout Current Commit
uses: actions/checkout@v3

- name: Run Automated Tests
run: make test

- name: Determine Changes
uses: dorny/paths-filter@v2
id: changes
with:
base: ${{ github.ref }}
filters: |
all:
deploy-game:
- "internal/**"
- ".github/workflows/deploy-dev.yml"
- ".github/workflows/run-tests.yml"
- "go.mod"
- "go.sum"
lambda:
- "build/package/lambda/**"
- "cmd/lambda/**"
- "internal/driven/storage/dynamodb/**"
- "deploy/aws/lambda/infras.yml"
- "deploy/aws/lambda/service.yml"

- name: Notify To Slack If Failed
uses: lazy-actions/[email protected]
if: failure()
with:
type: ${{ job.status }}
job_name: "*[hex-monscape]* ${{ github.job }}"
mention: "here"
mention_if: "failure"
channel: "#solutions-team-ci-cd"
icon_emoji: ":haraaj:"
username: "ci/cd-reporter"
url: ${{ secrets.SOLUTIONS_TEAM_SLACK_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}

deploy-game:
name: Deploy Game
needs: preparation
Expand All @@ -57,7 +65,7 @@ jobs:
INFRA_STACK_NAME_DEV: hex-monscape-infras
steps:
- name: Checkout Current Commit
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
84 changes: 0 additions & 84 deletions .github/workflows/tests.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
.vscode
**/*.DS_Store
.tmp
**/*.DS_Store
4 changes: 4 additions & 0 deletions .output/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!.gitignore
!cov-report/
!cov-report/*
5 changes: 5 additions & 0 deletions .output/cov-report/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Coverage Report

The [coverage.out](./coverage.out) file was generated by [this command](../../build/package/tests/Dockerfile#L11). It will be automatically updated when [ci.yaml](../../.github/workflows/ci.yml) workflow is triggered.

The coverage report is one of the requirements for submitting this project to [Awesome Go](https://github.com/avelino/awesome-go).
Loading
Loading