Skip to content

Commit

Permalink
Update to tmpl-go template repository version 0.12.0
Browse files Browse the repository at this point in the history
Updated to `tmpl-go` version 0.12.0 [1], including the versions in
between starting from 0.7.0 [3]:

1. Updated to Go 1.17 [4].
2. Updated to golangci-lint `v1.43.0` [5].
3. Updated to `tmpl` template repository version `0.11.0` [6].
4. Optimized GitHub action workflows for Go and Node [7].
5. Disabled golangci-lint's default excluded issues [8].
6. Introduced Go dependency caching and build outputs in `ci-go`
   workflow [9].
7. Disabled revive linter rule `package-comments` [10].
8. Fixed golangci-lint fail to run due to `revives` unknown `time-equal`
   rule [11].
9. updated Node.js packages & GitHub actions [12].

This also included changes required for any linter matches.

[1]: https://github.com/svengreb/tmpl-go/releases/tag/v0.12.0
[3]: https://github.com/svengreb/tmpl-go/releases/tag/v0.7.0
[4]: svengreb/tmpl-go#66
[5]: svengreb/tmpl-go#64
[6]: svengreb/tmpl-go#91
[7]: svengreb/tmpl-go#68
[8]: svengreb/tmpl-go#72
[9]: svengreb/tmpl-go#74
[10]: svengreb/tmpl-go#78
[11]: svengreb/tmpl-go#76
[12]: svengreb/tmpl-go#42

GH-62
  • Loading branch information
svengreb committed May 9, 2022
1 parent 723abd5 commit 797b5ba
Show file tree
Hide file tree
Showing 32 changed files with 10,432 additions and 2,752 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Copyright (c) 2020-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the LICENSE file.

# Configurations for EditorConfig.
# See https://editorconfig.org/#file-format-details for more details.

# +--------------------+
# + Base Configuration +
# +--------------------+
root = true

[*]
charset = utf-8
end_of_line = lf
Expand Down
7 changes: 4 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# This source code is licensed under the MIT license found in the LICENSE file.

# Configuration to define attributes per path.
# See the following references for more details:
# - https://git-scm.com/docs/gitattributes
# - https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Keyword-Expansion
#
# References:
# 1. https://git-scm.com/docs/gitattributes
# 2. https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Keyword-Expansion

# Automatically perform line feed (LF) normalization for files detected as text and
# leave all files detected as binary untouched.
Expand Down
5 changes: 3 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

# Configuration for the GitHub feature to automatically request reviews from the code owners
# when a pull request changes any owned files.
# See:
# 1. https://help.github.com/articles/about-codeowners
#
# References:
# 1. https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
# 2. https://github.com/blog/2392-introducing-code-owners

# +----------------------+
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This section and the instructions in the sections below are only part of this pu

Please do your best to provide as much information as possible and use a clear and descriptive title for your enhancement suggestion or bug fix to help maintainers and the community understand and reproduce the behavior, find related pull requests and to merge it faster.

- **Ensure the pull request has not already been submitted by using the [GitHub Issue search](https://github.com/svengreb/nib/issues)** — check if this enhancement or bug fix has already been suggested. If it has **and the pull request is still open**, add your additions as comment or [suggest a change](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request#applying-a-suggested-change) to the existing pull request instead of opening a new one. If you find a closed pull request that seems to be similar to this one, include a link to the original pull request in the [metadata head](#metadata-head) section of this new pull request.
- **Ensure the pull request has not already been submitted by using the [GitHub Pull Request search](https://github.com/svengreb/nib/pulls)** — check if this enhancement or bug fix has already been suggested. If it has **and the pull request is still open**, add your additions as comment or [suggest a change](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request#applying-a-suggested-change) to the existing pull request instead of opening a new one. If you find a closed pull request that seems to be similar to this one, include a link to the original pull request in the [metadata head](#metadata-head) section of this new pull request.
- **Ensure to adhere to the [pull request contribution guidelines](https://github.com/svengreb/nib/blob/main/CONTRIBUTING.md#pull-requests)**, especially the one for tests and documentations.
- **Check if the enhancement has already been implemented or bug already fixed** — use the [latest version](https://github.com/svengreb/nib/releases/latest) and [`main`](https://github.com/svengreb/nib/tree/main) branch to ensure that the enhancement or bug fix has not already been added.

Expand Down
43 changes: 0 additions & 43 deletions .github/dependabot.yml

This file was deleted.

60 changes: 32 additions & 28 deletions .github/workflows/ci.yml → .github/workflows/ci-go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
# GitHub Action Workflow for continuous integration jobs.
# See https://docs.github.com/en/actions and https://github.com/features/actions for more details.

name: ci
name: ci-go
on:
push:
paths:
- "**.go"
branches:
- main
tags:
- v*
pull_request:
paths:
- "**.go"

jobs:
lint-node:
lint:
runs-on: ubuntu-latest
steps:
- name: Print metadata and context information
Expand All @@ -24,38 +28,20 @@ jobs:
echo "Workflow Actor: $GITHUB_ACTOR"
- name: Checkout repository
uses: actions/checkout@v2
- name: "Setup Node.js version ${{ matrix.node-version }}"
uses: actions/setup-node@v2.1.5
with:
node-version: "14.x"
- name: Install Node modules
run: yarn --frozen-lockfile
- name: Run linters
run: yarn lint
lint-go:
runs-on: ubuntu-latest
steps:
- name: Print metadata and context information
run: |
echo "Git SHA: $GITHUB_SHA"
echo "Git Ref: $GITHUB_REF"
echo "Workflow Actor: $GITHUB_ACTOR"
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Go
- name: Install Go 1.17
uses: actions/setup-go@v2
with:
go-version: "1.15.x"
go-version: "1.17.x"
- name: "Run golangci-lint"
# The official golangci-lint action created and maintained by the golangci-lint project.
# See https://github.com/golangci/golangci-lint-action for more details.
uses: golangci/golangci-lint-action@v2.5.2
with:
version: v1.32
version: v1.43
test:
runs-on: ubuntu-latest
needs:
- lint-go
- lint
steps:
- name: Print metadata and context information
run: |
Expand All @@ -64,9 +50,27 @@ jobs:
echo "Workflow Actor: $GITHUB_ACTOR"
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Go
with:
# Ensure to fetch all history for all tags and branches for other steps, e.g. when bootstrapping the tools,
# otherwise this can result in errors when trying to query for repository metadata like the tag.
# See https://github.com/actions/checkout#Fetch-all-history-for-all-tags-and-branches for more details.
fetch-depth: 0
- name: Install Go 1.17
uses: actions/setup-go@v2
with:
go-version: "1.15.x"
- name: "Run tests with coverage and race detector"
run: go test -cover -race -v ./...
go-version: "1.17.x"
- name: Bootstrap tools
run: go run make.go bootstrap
- name: Cache Go dependencies and build outputs
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run unit tests with coverage and race detector
run: go run make.go testCover testRace
- name: Run integration tests
run: go run make.go testIntegration
47 changes: 47 additions & 0 deletions .github/workflows/ci-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (c) 2020-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the LICENSE file.

# GitHub Action Workflow for continuous integration jobs.
# See https://docs.github.com/en/actions and https://github.com/features/actions for more details.

name: ci-node
on:
push:
paths:
- "**.js"
- "**.json"
- "**.md"
- "**.yaml"
- "**.yml"
branches:
- main
tags:
- v*
pull_request:
paths:
- "**.js"
- "**.json"
- "**.md"
- "**.yaml"
- "**.yml"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Print metadata and context information
run: |
echo "Git SHA: $GITHUB_SHA"
echo "Git Ref: $GITHUB_REF"
echo "Workflow Actor: $GITHUB_ACTOR"
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Node.js version 16
uses: actions/setup-node@v2.4.1
with:
node-version: "16"
cache: "npm"
- name: Install Node modules
run: npm ci
- name: Run linters in CI/CD mode
run: npm run lint:ci
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2020-present Sven Greb <development@svengreb.de>
# This source code is licensed under the MIT license found in the LICENSE file.

# Configuration to specify paths to ignore.
# Path match pattern to intentionally ignore untracked files and directories.
# See https://git-scm.com/docs/gitignore for more details.

# +--------------------+
Expand All @@ -17,9 +17,6 @@
# + Node.js +
# +---------+
**/node_modules/
yarn-debug.log*
yarn-error.log*
.yarn-integrity

# +-------------------+
# + Project Structure +
Expand Down
Loading

0 comments on commit 797b5ba

Please sign in to comment.