Skip to content

Commit 9485600

Browse files
authored
Merge pull request #114 from fullstack-devops/feature/update-project-structure
Feature: Project layout refactoring
2 parents d915c6f + 1f7cab0 commit 9485600

File tree

122 files changed

+3987
-2718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+3987
-2718
lines changed

.chglog/CHANGELOG.tpl.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{{ if .Versions -}}
2+
<a name="unreleased"></a>
3+
## [Unreleased]
4+
5+
{{ if .Unreleased.CommitGroups -}}
6+
{{ range .Unreleased.CommitGroups -}}
7+
### {{ .Title }}
8+
{{ range .Commits -}}
9+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
10+
{{ end }}
11+
{{ end -}}
12+
{{ end -}}
13+
{{ end -}}
14+
15+
{{ range .Versions }}
16+
<a name="{{ .Tag.Name }}"></a>
17+
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
18+
{{ range .CommitGroups -}}
19+
### {{ .Title }}
20+
{{ range .Commits -}}
21+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
22+
{{ end }}
23+
{{ end -}}
24+
25+
{{- if .MergeCommits -}}
26+
### Pull Requests
27+
{{ range .MergeCommits -}}
28+
- {{ .Header }}
29+
{{ end }}
30+
{{ end -}}
31+
32+
{{- if .NoteGroups -}}
33+
{{ range .NoteGroups -}}
34+
### {{ .Title }}
35+
{{ range .Notes }}
36+
{{ .Body }}
37+
{{ end }}
38+
{{ end -}}
39+
{{ end -}}
40+
{{ end -}}
41+
42+
{{- if .Versions }}
43+
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
44+
{{ range .Versions -}}
45+
{{ if .Tag.Previous -}}
46+
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
47+
{{ end -}}
48+
{{ end -}}
49+
{{ end -}}

.chglog/config.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
style: github
2+
template: CHANGELOG.tpl.md
3+
info:
4+
title: CHANGELOG
5+
repository_url: https://github.com/fullstack-devops/awesome-ci
6+
options:
7+
commits:
8+
filters:
9+
Type:
10+
- feat
11+
- fix
12+
- perf
13+
- refactor
14+
commit_groups:
15+
title_maps:
16+
feat: Features
17+
fix: Bug Fixes
18+
perf: Performance Improvements
19+
refactor: Code Refactoring
20+
header:
21+
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:\\s(.*)$"
22+
pattern_maps:
23+
- Type
24+
- Scope
25+
- Subject
26+
notes:
27+
keywords:
28+
- BREAKING CHANGE
29+
issues:
30+
prefix:
31+
- bugfix

.github/dependabot.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,12 @@ version: 2
77
updates:
88
- package-ecosystem: "gomod" # See documentation for possible values
99
directory: "/" # Location of package manifests
10+
rebase-strategy: auto
1011
schedule:
11-
interval: "daily"
12+
interval: "daily"
13+
14+
- package-ecosystem: "github-actions"
15+
directory: "/"
16+
rebase-strategy: auto
17+
schedule:
18+
interval: "weekly"

.github/workflows/Release.yaml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@ on:
88
push:
99
branches:
1010
- "main"
11-
paths:
12-
- ".github/workflows/**"
13-
- "src/**"
14-
- "tests/**"
15-
- "go.**"
16-
- "**.go"
17-
- "Makefile"
11+
paths-ignore:
12+
- "docs/**"
1813

1914
jobs:
2015
create_release:
@@ -30,55 +25,51 @@ jobs:
3025
arch: ["amd64", "arm64"]
3126
steps:
3227
- name: Checkout code
33-
uses: actions/checkout@v2
28+
uses: actions/checkout@v3
3429
- name: Set up Go
35-
uses: actions/setup-go@v2
30+
uses: actions/setup-go@v3
3631
with:
37-
go-version: 1.17
32+
go-version: 1.19
3833

3934
- name: Build "${{ matrix.arch }}"
40-
run: go build -v -ldflags "-X main.version=${{ needs.create_release.outputs.version }}" -o out/awesome-ci_${{ needs.create_release.outputs.version }}_${{ matrix.arch }}
35+
run: make VERSION="${{ needs.create_release.outputs.version }}"
4136
env:
4237
GOOS: linux
4338
GOARCH: "${{ matrix.arch }}"
4439

4540
- name: Cache build outputs
46-
uses: actions/cache@v2
41+
uses: actions/cache@v3
4742
env:
4843
cache-name: cache-outputs-modules
4944
with:
50-
path: out/
51-
key: awesome-ci-${{ github.sha }}-${{ hashFiles('out/awesome-ci*') }}
45+
path: build/package/
46+
key: awesome-ci-${{ github.sha }}-${{ hashFiles('build/package/awesome-ci*') }}
5247
restore-keys: |
5348
awesome-ci-${{ github.sha }}
54-
#- name: Integration testing
55-
# run: ./tools/test.sh ./out/awesome-ci_${ACI_NEXT_VERSION}_${{ matrix.arch }}
56-
# env:
57-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5849
5950
publish_release:
6051
runs-on: ubuntu-latest
6152
needs: [create_release, build]
6253
steps:
6354
- name: Checkout code
64-
uses: actions/checkout@v2
55+
uses: actions/checkout@v3
6556
- name: Setup awesome-ci
6657
uses: fullstack-devops/awesome-ci-action@main
6758

6859
- name: get cached build outputs
69-
uses: actions/cache@v2
60+
uses: actions/cache@v3
7061
env:
7162
cache-name: cache-outputs-modules
7263
with:
73-
path: out/
64+
path: build/package/
7465
key: awesome-ci-${{ github.sha }}
7566

7667
- name: get generated artifacts
77-
working-directory: out
68+
working-directory: build/package
7869
run: ls -la
7970

8071
- name: Publish Release
81-
run: awesome-ci release publish -releaseid "$ACI_RELEASE_ID" -assets "file=out/$ARTIFACT1,file=out/$ARTIFACT2" -body "release-template.md"
72+
run: awesome-ci release publish -releaseid "$ACI_RELEASE_ID" -assets "file=build/package/$ARTIFACT1,file=build/package/$ARTIFACT2" -body "scripts/release-template.md"
8273
env:
8374
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8475
ACI_RELEASE_ID: ${{ needs.create_release.outputs.releaseid }}
@@ -90,7 +81,7 @@ jobs:
9081
needs: [create_release, publish_release]
9182
steps:
9283
- name: Check out awesome-ci-action
93-
uses: actions/checkout@v2
84+
uses: actions/checkout@v3
9485
with:
9586
repository: fullstack-devops/awesome-ci-action
9687
token: ${{ secrets.ACI_REPO_TOKEN }}

.github/workflows/branchPR.yaml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,55 @@ jobs:
1616
matrix:
1717
arch: ["amd64", "arm64"]
1818
steps:
19+
- run: export
1920
- name: Checkout code
20-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
2122
with:
2223
fetch-depth: 0
2324
- name: Set up Go
24-
uses: actions/setup-go@v2
25+
uses: actions/setup-go@v3
2526
with:
26-
go-version: 1.17
27+
go-version: 1.19
2728
- name: Setup awesome-ci
2829
uses: fullstack-devops/awesome-ci-action@main
2930

3031
- name: Build "${{ matrix.arch }}"
31-
run: go build -v -ldflags "-X main.version=${{ needs.generate_infos.outputs.version }}" -o out/awesome-ci_${{ needs.generate_infos.outputs.version }}_${{ matrix.arch }}
32+
run: make
3233
env:
3334
GOOS: linux
3435
GOARCH: "${{ matrix.arch }}"
3536

37+
- name: Test "${{ matrix.arch }}"
38+
if: matrix.arch == 'amd64'
39+
run: make test
40+
3641
- name: debugging git
3742
if: matrix.arch == 'amd64'
3843
run: |
3944
echo "git name-rev HEAD: $(git name-rev HEAD)"
4045
echo "git log -1 --pretty=format:"%s": $(git log -1 --pretty=format:"%s")"
4146
echo "git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@': $(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"
47+
4248
- name: test build Infos
49+
id: test-build-infos
4350
if: matrix.arch == 'amd64'
44-
run: out/awesome-ci_${{ needs.generate_infos.outputs.version }}_${{ matrix.arch }} pr info -number ${{ github.event.pull_request.number }}
51+
run: build/package/awesome-ci_* pr info -n ${{ github.event.pull_request.number }} -v > $GITHUB_STEP_SUMMARY
4552
env:
4653
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
- name: test env file
55+
if: matrix.arch == 'amd64'
56+
run: export | grep ACI_
57+
- name: test step export function
58+
if: matrix.arch == 'amd64'
59+
run: echo "${{ steps.test-build-infos.outputs.ACI_PR_BRANCH }}"
4760

4861
- name: Cache build outputs
49-
uses: actions/cache@v2
62+
uses: actions/cache@v3
5063
env:
5164
cache-name: cache-outputs-modules
5265
with:
53-
path: out/
54-
key: awesome-ci-${{ github.event.pull_request.head.sha }}-${{ hashFiles('out/awesome-ci*') }}
66+
path: build/package/
67+
key: awesome-ci-${{ github.event.pull_request.head.sha }}-${{ hashFiles('build/package/awesome-ci*') }}
5568
restore-keys: |
5669
awesome-ci-${{ github.event.pull_request.head.sha }}
5770
@@ -65,19 +78,20 @@ jobs:
6578
needs: [generate_infos, build]
6679
steps:
6780
- name: Checkout code
68-
uses: actions/checkout@v2
81+
uses: actions/checkout@v3
6982
- name: Setup awesome-ci
7083
uses: fullstack-devops/awesome-ci-action@main
7184

85+
- run: echo "${{ needs.build.steps.test-build-infos.outputs.ACI_PR_BRANCH }}"
86+
7287
- name: get cached build outputs
73-
uses: actions/cache@v2
88+
uses: actions/cache@v3
7489
env:
7590
cache-name: cache-outputs-modules
7691
with:
77-
path: out/
92+
path: build/package/
7893
key: awesome-ci-${{ github.event.pull_request.head.sha }}
7994

8095
- name: get generated artifacts
81-
working-directory: out
96+
working-directory: build/package
8297
run: ls -la
83-

.github/workflows/codeql-analysis.yml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ main ]
16+
branches: [main]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ main ]
19+
branches: [main]
2020
schedule:
21-
- cron: '21 13 * * 5'
21+
- cron: "21 13 * * 5"
2222

2323
jobs:
2424
analyze:
@@ -32,40 +32,40 @@ jobs:
3232
strategy:
3333
fail-fast: false
3434
matrix:
35-
language: [ 'go' ]
35+
language: ["go"]
3636
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
3737
# Learn more:
3838
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
3939

4040
steps:
41-
- name: Checkout repository
42-
uses: actions/checkout@v2
41+
- name: Checkout repository
42+
uses: actions/checkout@v3
4343

44-
# Initializes the CodeQL tools for scanning.
45-
- name: Initialize CodeQL
46-
uses: github/codeql-action/init@v1
47-
with:
48-
languages: ${{ matrix.language }}
49-
# If you wish to specify custom queries, you can do so here or in a config file.
50-
# By default, queries listed here will override any specified in a config file.
51-
# Prefix the list here with "+" to use these queries and those in the config file.
52-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
44+
# Initializes the CodeQL tools for scanning.
45+
- name: Initialize CodeQL
46+
uses: github/codeql-action/init@v1
47+
with:
48+
languages: ${{ matrix.language }}
49+
# If you wish to specify custom queries, you can do so here or in a config file.
50+
# By default, queries listed here will override any specified in a config file.
51+
# Prefix the list here with "+" to use these queries and those in the config file.
52+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
5353

54-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55-
# If this step fails, then you should remove it and run the build manually (see below)
56-
- name: Autobuild
57-
uses: github/codeql-action/autobuild@v1
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
- name: Autobuild
57+
uses: github/codeql-action/autobuild@v1
5858

59-
# ℹ️ Command-line programs to run using the OS shell.
60-
# 📚 https://git.io/JvXDl
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 https://git.io/JvXDl
6161

62-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63-
# and modify them (or add more) to build your code if your project
64-
# uses a compiled language
62+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63+
# and modify them (or add more) to build your code if your project
64+
# uses a compiled language
6565

66-
#- run: |
67-
# make bootstrap
68-
# make release
66+
#- run: |
67+
# make bootstrap
68+
# make release
6969

70-
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v1
70+
- name: Perform CodeQL Analysis
71+
uses: github/codeql-action/analyze@v1

.gitignore

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# If you prefer the allow list template instead of the deny list, see community template:
2+
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3+
#
14
# Binaries for programs and plugins
25
*.exe
36
*.exe~
@@ -10,10 +13,25 @@
1013

1114
# Output of the go coverage tool, specifically when used with LiteIDE
1215
*.out
16+
out/*
1317

1418
# Dependency directories (remove the comment below to include it)
1519
# vendor/
16-
out
20+
21+
# Go workspace file
22+
go.work
23+
/docs/architecture/.asciidoctor/
24+
/build/docs/.asciidoctor/
25+
/build/coverage/
26+
/build/package/
27+
!/build/**/.keep
28+
/.idea
29+
1730
*.env
18-
awesome-ci
1931
tests/github_env
32+
test.txt
33+
34+
docs/_site
35+
# awesome specialties
36+
.awesomerc.yaml
37+
awesome.env

0 commit comments

Comments
 (0)