Skip to content

Commit

Permalink
#71 Savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Jul 10, 2024
1 parent 903f3a7 commit 46eae2b
Show file tree
Hide file tree
Showing 36 changed files with 475 additions and 191 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ CODE_OF_CONDUCT.md
CONTRIBUTING.md
docker-compose.test.yml
LICENSE
PULL_REQUEST_TEMPLATE.md
README.md
README.md
8 changes: 8 additions & 0 deletions .github/coverage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Coverage

## testcoverage.yaml

- Used by `coverage:` in
- [go-test-darwin.yaml](../workflows/go-test-darwin.yaml)
- [go-test-linux.yaml](../workflows/go-test-linux.yaml)
- [go-test-windows.yaml](../workflows/go-test-windows.yaml)
File renamed without changes.
3 changes: 2 additions & 1 deletion .github/linters/.checkov.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
quiet: true
skip-check: CKV_DOCKER_7
skip-check:
- CKV_DOCKER_7
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
run:
modules-download-mode: readonly
show-stats: true
timeout: 10m

output:
print-linter-name: false
show-stats: true
sort-results: true

linters:
Expand Down
6 changes: 1 addition & 5 deletions .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{
"ignore": [
"**/*.go,**/go-test*.yaml"
]
}
{}
28 changes: 28 additions & 0 deletions .github/linters/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Linters

## .checkov.yaml

- Used by [???](https://)

## .golangci.yaml

- Used by [golangci-lint.yaml](../workflows/golangci-lint.yaml)
- [golangci-lint](https://golangci-lint.run/)
- [Configuration](https://golangci-lint.run/usage/configuration/)

## .jscpd.json

- Used by
- [Options](https://github.com/kucherenko/jscpd/tree/master/apps/jscpd#options)
- Example:

```json
{
"ignore": [
"**/*.go,**/go-test*.yaml"
],
"threshold": 10
}
```

## .yaml-lint.yml
73 changes: 73 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Workflows

## add-labels-standardized.yaml

- [GitHub Action](add-labels-standardized.yaml)
- uses [senzing-factory/build-resources/...add-labels-to-issue.yaml)](https://github.com/senzing-factory/build-resources/blob/main/.github/workflows/add-labels-to-issue.yaml)

## add-to-project-garage-dependabot.yaml

- [GitHub Action](add-to-project-garage-dependabot.yaml)
- uses [senzing-factory/build-resources/.../add-to-project-dependabot.yaml](https://github.com/senzing-factory/build-resources/blob/main/.github/workflows/add-to-project-dependabot.yaml)

## add-to-project-garage.yaml

- [GitHub Action](add-to-project-garage.yaml)
- uses [senzing-factory/build-resources/.../add-to-project-dependabot.yaml](https://github.com/senzing-factory/build-resources/blob/main/.github/workflows/add-to-project.yaml)

## dependabot-approve-and-merge.yaml

- [GitHub Action](dependabot-approve-and-merge.yaml)
- uses [senzing-factory/build-resources/.../dependabot-approve-and-merge.yaml](https://github.com/senzing-factory/build-resources/blob/main/.github/workflows/dependabot-approve-and-merge.yaml)

## docker-build-container.yaml

- [GitHub Action](docker-build-container.yaml)
- uses [senzing-factory/github-action-docker-buildx-build](https://github.com/senzing-factory/github-action-docker-buildx-build)

## docker-push-containers-to-dockerhub.yaml

- [GitHub Action](docker-push-containers-to-dockerhub.yaml)
- uses [senzing-factory/github-action-docker-buildx-build](https://github.com/senzing-factory/github-action-docker-buildx-build)

## golangci-lint.yaml

- [GitHub Action](golangci-lint.yaml)
- uses [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action)

## go-proxy-pull.yaml

- [GitHub Action](go-proxy-pull.yaml)
- uses [andrewslotin/go-proxy-pull-action](https://github.com/andrewslotin/go-proxy-pull-action)

## go-test-darwin.yaml

- [GitHub Action](go-test-darwin.yaml)

## go-test-linux.yaml

- [GitHub Action](go-test-linux.yaml)

## go-test-windows.yaml

- [GitHub Action](go-test-windows.yaml)

## lint-workflows.yaml

- [GitHub Action](lint-workflows.yaml)
- uses [senzing-factory/build-resources/.../lint-workflows.yaml](https://github.com/senzing-factory/build-resources/blob/main/.github/workflows/lint-workflows.yaml)

## make-go-github-file.yaml

- [GitHub Action](make-go-github-file.yaml)
- uses [senzing-factory/build-resources/.../make-go-github-file.yaml](https://github.com/senzing-factory/build-resources/blob/main/.github/workflows/make-go-github-file.yaml)

## make-go-tag.yaml

- [GitHub Action](make-go-tag.yaml)
- uses [senzing-factory/github-action-make-go-tag](https://github.com/senzing-factory/github-action-make-go-tag)

## move-pr-to-done-dependabot.yaml

- [GitHub Action](move-pr-to-done-dependabot.yaml)
- uses [senzing-factory/build-resources/.../move-pr-to-done-dependabot.yaml](https://github.com/senzing-factory/build-resources/blob/main/.github/workflows/move-pr-to-done-dependabot.yaml)
2 changes: 1 addition & 1 deletion .github/workflows/add-labels-standardized.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: add labels standardized
name: Add labels standardized

on:
issues:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/add-to-project-garage-dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: add to project garage dependabot
name: Add to project garage dependabot

on:
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/add-to-project-garage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: add to project garage
name: Add to project garage

on:
issues:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-approve-and-merge.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: dependabot approve and merge
name: Dependabot approve and merge

on:
pull_request:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/go-proxy-pull.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: go proxy pull
name: Go proxy pull

on:
push:
Expand All @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: pull new module version
- name: Pull new module version
uses: andrewslotin/go-proxy-pull-action@v1.2.0
with:
import_path: github.com/senzing-garage/go-cmdhelping
import_path: github.com/${{ github.repository }}
31 changes: 20 additions & 11 deletions .github/workflows/go-test-darwin.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: go test darwin
name: Go test darwin

on: [pull_request, workflow_dispatch]

Expand All @@ -7,40 +7,49 @@ permissions:

jobs:
go-test-darwin:
name: "go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
name: "Go test with OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
os: [macos-13]
senzingapi-version: [staging-v4]

steps:
- name: checkout repository
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup go
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: install Senzing API
uses: senzing-factory/github-action-install-senzing-api@v3
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
senzingapi-version: ${{ matrix.senzingapi-version }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: run go test
run: go test -v -p 1 -coverprofile=./cover.out -covermode=atomic -coverpkg=./... ./...
- name: Run go test
run: go test -json -v -p 1 -coverprofile=./cover.out -covermode=atomic -coverpkg=./... ./... 2>&1 | tee /tmp/gotest.log | gotestfmt

- name: Store coverage file
uses: actions/upload-artifact@v4
with:
name: cover.out
path: ./cover.out

- name: Upload test log
uses: actions/upload-artifact@v4
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error

coverage:
name: coverage
name: Coverage
needs: go-test-darwin
uses: senzing-factory/build-resources/.github/workflows/go-coverage.yaml@v2
with:
coverage-config: ./.github/coverage/testcoverage.yaml
31 changes: 20 additions & 11 deletions .github/workflows/go-test-linux.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: go test linux
name: Go test linux

on: [push]

Expand All @@ -7,40 +7,49 @@ permissions:

jobs:
go-test-linux:
name: "go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
name: "Go test with OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
os: [ubuntu-latest]
senzingapi-version: [staging-v4]

steps:
- name: checkout repository
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup go
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: install Senzing API
uses: senzing-factory/github-action-install-senzing-api@v3
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
senzingapi-runtime-version: ${{ matrix.senzingapi-version }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: run go test
run: go test -v -p 1 -coverprofile=./cover.out -covermode=atomic -coverpkg=./... ./...
- name: Run go test
run: go test -json -v -p 1 -coverprofile=./cover.out -covermode=atomic -coverpkg=./... ./... 2>&1 | tee /tmp/gotest.log | gotestfmt

- name: Store coverage file
uses: actions/upload-artifact@v4
with:
name: cover.out
path: ./cover.out

- name: Upload test log
uses: actions/upload-artifact@v4
if: always()
with:
name: test-log
path: /tmp/gotest.log
if-no-files-found: error

coverage:
name: coverage
name: Coverage
needs: go-test-linux
uses: senzing-factory/build-resources/.github/workflows/go-coverage.yaml@v2
with:
coverage-config: ./.github/coverage/testcoverage.yaml
31 changes: 20 additions & 11 deletions .github/workflows/go-test-windows.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: go test windows
name: Go test windows

on: [pull_request, workflow_dispatch]

Expand All @@ -7,33 +7,32 @@ permissions:

jobs:
go-test-windows:
name: "go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
name: "Go test with OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
os: [windows-latest]
senzingapi-version: [staging-v4]

steps:
- name: checkout repository
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: setup go
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: install Senzing API
uses: senzing-factory/github-action-install-senzing-api@v3
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
senzingapi-version: ${{ matrix.senzingapi-version }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: run go test
- name: Run go test
run: |
go test -v -p 1 -coverprofile=cover -covermode=atomic -coverpkg=./... ./...
go test -json -v -p 1 -coverprofile=cover -covermode=atomic -coverpkg=./... ./... 2>&1 | tee "C:\Temp\gotest.log" | gotestfmt
cp cover cover.out
- name: Store coverage file
Expand All @@ -42,7 +41,17 @@ jobs:
name: cover.out
path: cover.out

- name: Upload test log
uses: actions/upload-artifact@v4
if: always()
with:
name: test-log
path: "C:\\Temp\\gotest.log"
if-no-files-found: error

coverage:
name: coverage
name: Coverage
needs: go-test-windows
uses: senzing-factory/build-resources/.github/workflows/go-coverage.yaml@v2
with:
coverage-config: ./.github/coverage/testcoverage.yaml
Loading

0 comments on commit 46eae2b

Please sign in to comment.