-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable CI/CD for Golang mono repo (#65)
- Loading branch information
Showing
7 changed files
with
148 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
## | ||
## Build the main branch | ||
## | ||
name: build | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- /refs/heads/main | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
module: [".", "x/awsapi", "x/xhtml"] | ||
|
||
steps: | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.21" | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: go build | ||
working-directory: ${{ matrix.module }} | ||
run: | | ||
go build ./... | ||
- name: go test | ||
working-directory: ${{ matrix.module }} | ||
run: | | ||
go test -coverprofile=profile.cov $(go list ./... | grep -v /examples/) | ||
- uses: shogo82148/actions-goveralls@v1 | ||
continue-on-error: true | ||
with: | ||
working-directory: ${{ matrix.module }} | ||
path-to-profile: profile.cov | ||
flag-name: ${{ matrix.module }} | ||
parallel: true | ||
|
||
- name: release | ||
working-directory: ${{ matrix.module }} | ||
run: | | ||
git config user.name "GitHub Actions" | ||
git config user.email "github-actions@users.noreply.github.com" | ||
for mod in `grep -roh "const Version = \".*" * | grep -Eoh "([[:alnum:]]*/*){1,}v[0-9]*\.[0-9]*\.[0-9]*"` | ||
do | ||
git tag $mod 2> /dev/null && git push origin -u $mod 2> /dev/null && echo "[+] $mod" || echo "[ ] $mod" | ||
done | ||
finish: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
parallel-finished: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
### | ||
## Unit Tests & Coverage | ||
## | ||
name: check | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
|
||
unit: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
module: [".", "x/awsapi", "x/xhtml"] | ||
|
||
steps: | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.21" | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: go build | ||
working-directory: ${{ matrix.module }} | ||
run: | | ||
go build ./... | ||
- name: go test | ||
working-directory: ${{ matrix.module }} | ||
run: | | ||
go test -coverprofile=profile.cov $(go list ./... | grep -v /examples/) | ||
- uses: shogo82148/actions-goveralls@v1 | ||
continue-on-error: true | ||
with: | ||
working-directory: ${{ matrix.module }} | ||
path-to-profile: profile.cov | ||
flag-name: ${{ matrix.module }} | ||
parallel: true | ||
|
||
- uses: dominikh/staticcheck-action@v1.3.0 | ||
with: | ||
install-go: false | ||
working-directory: ${{ matrix.module }} | ||
|
||
finish: | ||
needs: unit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
parallel-finished: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// Copyright (C) 2019 - 2024 Dmitry Kolesnikov | ||
// | ||
// This file may be modified and distributed under the terms | ||
// of the MIT license. See the LICENSE file for details. | ||
// https://github.com/fogfish/gurl | ||
// | ||
|
||
package gurl | ||
|
||
const Version = "v2.9.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// Copyright (C) 2019 - 2024 Dmitry Kolesnikov | ||
// | ||
// This file may be modified and distributed under the terms | ||
// of the MIT license. See the LICENSE file for details. | ||
// https://github.com/fogfish/gurl | ||
// | ||
|
||
package awsapi | ||
|
||
const Version = "x/awsapi/v0.0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// Copyright (C) 2019 - 2024 Dmitry Kolesnikov | ||
// | ||
// This file may be modified and distributed under the terms | ||
// of the MIT license. See the LICENSE file for details. | ||
// https://github.com/fogfish/gurl | ||
// | ||
|
||
package xhtml | ||
|
||
const Version = "x/xhtml/v0.0.2" |