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

71 dockter 1 #72

Merged
merged 10 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
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)
6 changes: 3 additions & 3 deletions .testcoverage.yml → .github/coverage/testcoverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ local-prefix: "github.com/org/project"
threshold:
# (optional; default 0)
# The minimum coverage that each file should have
file: 80
file: 90

# (optional; default 0)
# The minimum coverage that each package should have
package: 80
package: 90

# (optional; default 0)
# The minimum total coverage project should have
total: 80
total: 90
# Holds regexp rules which will override thresholds for matched files or packages
# using their paths.
#
Expand Down
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 }}
36 changes: 28 additions & 8 deletions .github/workflows/go-test-darwin.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: go test darwin
name: Go test darwin

on: [pull_request, workflow_dispatch]

env:
DYLD_LIBRARY_PATH: /opt/senzing/g2/lib:/opt/senzing/g2/lib/macos
LD_LIBRARY_PATH: /opt/senzing/g2/lib:/opt/senzing/g2/lib/macos
SENZING_TOOLS_DATABASE_URL: "sqlite3://na:na@nowhere/tmp/sqlite/G2C.db"

permissions:
contents: read

jobs:
go-test-darwin:
name: "go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
name: "Go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -16,31 +21,46 @@ jobs:
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
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Senzing API
uses: senzing-factory/github-action-install-senzing-api@v3
with:
senzingapi-version: ${{ matrix.senzingapi-version }}

- 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
36 changes: 28 additions & 8 deletions .github/workflows/go-test-linux.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: go test linux
name: Go test linux

on: [push]

env:
LD_LIBRARY_PATH: /opt/senzing/g2/lib
SENZING_LOG_LEVEL: TRACE
SENZING_TOOLS_DATABASE_URL: sqlite3://na:na@nowhere/tmp/sqlite/G2C.db

permissions:
contents: read

jobs:
go-test-linux:
name: "go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
name: "Go test with Senzing: ${{ matrix.senzingapi-version }}; OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -16,31 +21,46 @@ jobs:
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
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Senzing API
uses: senzing-factory/github-action-install-senzing-api@v3
with:
senzingapi-runtime-version: ${{ matrix.senzingapi-version }}

- 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
Loading
Loading