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

senzing-factory/build-resources#69 add linting #80

Merged
merged 4 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Extends the default yamllint config by adjusting some options.
extends: default

rules:
comments-indentation: disable
line-length:
level: warning
allow-non-breakable-inline-mappings: true
truthy: disable
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
5 changes: 2 additions & 3 deletions .github/workflows/add-to-project-garage-dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: 'add to project garage dependabot'
name: add to project garage dependabot

on:
pull_request:
branches: [main]

jobs:

add-to-project-dependabot:
secrets:
SENZING_GITHUB_PROJECT_RW_TOKEN: ${{ secrets.SENZING_GITHUB_PROJECT_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/add-to-project-dependabot.yaml@main
uses: senzing-factory/build-resources/.github/workflows/add-to-project-dependabot.yaml@v1
with:
project: ${{ vars.SENZING_PROJECT_GARAGE }}
9 changes: 5 additions & 4 deletions .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 All @@ -8,11 +8,12 @@ on:

jobs:
add-to-project:
name: Add issue to project
name: add issue to project
runs-on: ubuntu-latest

steps:
- name: Assign issue to project
- name: assign issue to project
uses: actions/add-to-project@v0.5.0
with:
project-url: https://github.com/orgs/${{ vars.SENZING_GITHUB_ACCOUNT_NAME }}/projects/${{ vars.SENZING_PROJECT_GARAGE }}
github-token: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }}
project-url: https://github.com/orgs/${{ vars.SENZING_GITHUB_ACCOUNT_NAME }}/projects/${{ vars.SENZING_PROJECT_GARAGE }}
6 changes: 4 additions & 2 deletions .github/workflows/dependabot-approve-and-merge.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: dependabot-approve-and-merge.yaml
name: dependabot approve and merge

on:
pull_request:
branches: [main]

jobs:
dependabot-approve-and-merge:
permissions:
contents: write
pull-requests: write
uses: senzing-factory/build-resources/.github/workflows/dependabot-approve-and-merge.yaml@main
secrets:
SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN: ${{ secrets.SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/dependabot-approve-and-merge.yaml@v1
11 changes: 3 additions & 8 deletions .github/workflows/go-proxy-pull.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# Based on
# - https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
# - https://github.com/marketplace/actions/go-proxy-warming
# - https://github.com/andrewslotin/go-proxy-pull-action
# - https://futurestud.io/tutorials/github-actions-run-a-workflow-when-creating-a-tag

name: go-proxy-pull.yaml
name: go proxy pull

on:
push:
Expand All @@ -17,8 +11,9 @@ permissions:
jobs:
go-proxy-pull:
runs-on: ubuntu-latest

steps:
- name: Pull new module version
- name: pull new module version
uses: andrewslotin/go-proxy-pull-action@v1.1.0
with:
import_path: github.com/senzing-garage/go-databasing
28 changes: 17 additions & 11 deletions .github/workflows/go-test-darwin.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Based on
# - https://github.com/marketplace/actions/setup-go-environment

name: go-test-darwin.yaml
name: go test darwin

on: [push]

Expand All @@ -25,31 +22,40 @@ permissions:

jobs:
go-test-darwin:
name: "go test with OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.21"]
os: [macos-latest]
name: "go test with OS: ${{ matrix.os }}; Go: ${{ matrix.go }}"

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 Docker
uses: docker-practice/actions-setup-docker@master

- name: install Docker
uses: docker-practice/actions-setup-docker@v1
timeout-minutes: 12
- name: PostgreSQL service

- name: postgreSQL service
run: docker run --detach --env POSTGRESQL_DATABASE --env POSTGRESQL_PASSWORD --env POSTGRESQL_POSTGRES_PASSWORD --env POSTGRESQL_USERNAME --publish 5432:5432 bitnami/postgresql:latest

- name: MsSQL service
run: docker run --detach --env ACCEPT_EULA --env MSSQL_PID --env MSSQL_SA_PASSWORD --publish 1433:1433 mcr.microsoft.com/mssql/server

- name: MySQL service
run: docker run --detach --env MYSQL_DATABASE --env MYSQL_PASSWORD --env MYSQL_ROOT_PASSWORD --env MYSQL_USER --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=6 --publish 3306:3306 bitnami/mysql

- run: mkdir /tmp/sqlite

- run: touch /tmp/sqlite/G2C.db
- name: Run go test

- name: run go test
run: go test -v -p 1 ./...
21 changes: 13 additions & 8 deletions .github/workflows/go-test-linux.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Based on
# - https://github.com/marketplace/actions/setup-go-environment

name: go-test-linux.yaml
name: go test linux

on: [push]

Expand All @@ -13,12 +10,13 @@ permissions:

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

services:
postgres:
env:
Expand All @@ -29,6 +27,7 @@ jobs:
image: bitnami/postgresql
ports:
- 5432:5432

mssql:
env:
ACCEPT_EULA: Y
Expand All @@ -37,6 +36,7 @@ jobs:
image: mcr.microsoft.com/mssql/server
ports:
- 1433:1433

mysql:
env:
MYSQL_DATABASE: G2
Expand All @@ -47,16 +47,21 @@ jobs:
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5

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

- run: mkdir /tmp/sqlite

- run: touch /tmp/sqlite/G2C.db
- name: Run go test

- name: run go test
run: go test -v -p 1 ./...
59 changes: 36 additions & 23 deletions .github/workflows/go-test-windows.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Based on
# - https://github.com/marketplace/actions/setup-go-environment

name: go-test-windows.yaml
name: go test windows

on: [push]

Expand All @@ -24,26 +21,28 @@ permissions:

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

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 Docker
# uses: docker-practice/actions-setup-docker@master

# - name: install Docker
# uses: docker-practice/actions-setup-docker@v1
# timeout-minutes: 12

# https://github.com/marketplace/actions/setup-postgresql-for-linux-macos-windows
- uses: ikalnytskyi/action-setup-postgres@v5
with:
username: senzing
Expand All @@ -54,34 +53,48 @@ jobs:

# - name: PostgreSQL service
# run: docker run --detach --env POSTGRESQL_DATABASE --env POSTGRESQL_PASSWORD --env POSTGRESQL_POSTGRES_PASSWORD --env POSTGRESQL_USERNAME --publish 5432:5432 bitnami/postgresql:latest

# - name: MsSQL service
# run: docker run --detach --env ACCEPT_EULA --env MSSQL_PID --env MSSQL_SA_PASSWORD --publish 1433:1433 mcr.microsoft.com/mssql/server

# - name: MySQL service
# run: docker run --detach --env MYSQL_DATABASE --env MYSQL_PASSWORD --env MYSQL_ROOT_PASSWORD --env MYSQL_USER --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=6 --publish 3306:3306 bitnami/mysql

- name: Create empty Sqlite database file
- name: create empty Sqlite database file
run: mkdir "C:\Temp\sqlite" && New-Item "C:\Temp\sqlite\G2C.db"
# - name: Run go test

# - name: run go test
# run: go test -v -p 1 ./...
- name: Run go test - main

- name: run go test - main
run: go test -v -p 1 ./.
# - name: Run go test - connector

# - name: run go test - connector
# run: go test -v -p 1 ./connector
- name: Run go test - connectordb2

- name: run go test - connectordb2
run: go test -v -p 1 ./connectordb2
- name: Run go test - connectormssql

- name: run go test - connectormssql
run: go test -v -p 1 ./connectormssql
- name: Run go test - connectormysql

- name: run go test - connectormysql
run: go test -v -p 1 ./connectormysql
# - name: Run go test - connectorpostgresql

# - name: run go test - connectorpostgresql
# run: go test -v -p 1 ./connectorpostgresql
- name: Run go test - connectorsqlite

- name: run go test - connectorsqlite
run: go test -v -p 1 ./connectorsqlite
- name: Run go test - dbhelper

- name: run go test - dbhelper
run: go test -v -p 1 ./dbhelper
# - name: Run go test - postgresql

# - name: run go test - postgresql
# run: go test -v -p 1 ./postgresql
- name: Run go test - sqlexecutor

- name: run go test - sqlexecutor
run: go test -v -p 1 ./sqlexecutor
- name: Run go test - main

- name: run go test - main
run: go test -v -p 1 ./.
4 changes: 2 additions & 2 deletions .github/workflows/gofmt.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: gofmt.yaml
name: gofmt

on:
pull_request:
Expand All @@ -9,4 +9,4 @@ permissions:

jobs:
gofmt:
uses: senzing-factory/build-resources/.github/workflows/gofmt.yaml@main
uses: senzing-factory/build-resources/.github/workflows/gofmt.yaml@v1
13 changes: 6 additions & 7 deletions .github/workflows/gosec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# Based on
# - https://github.com/securego/gosec

name: gosec.yaml
name: gosec

on:
push:
Expand All @@ -19,10 +16,12 @@ jobs:
runs-on: ubuntu-latest
env:
GO111MODULE: on

steps:
- name: Checkout Source
- name: checkout Source
uses: actions/checkout@v4
- name: Run Gosec Security Scanner
uses: securego/gosec@master

- name: run Gosec Security Scanner
uses: securego/gosec@v2.19.0
with:
args: ./...
17 changes: 17 additions & 0 deletions .github/workflows/lint-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: lint workflows

on:
push:
branches-ignore: [main]
pull_request:
branches: [main]

permissions:
contents: read
packages: read
pull-requests: read
statuses: write

jobs:
lint-workflows:
uses: senzing-factory/build-resources/.github/workflows/lint-workflows.yaml@v1
9 changes: 5 additions & 4 deletions .github/workflows/make-go-tag.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'make go tag'
name: make go tag

on:
push:
Expand All @@ -10,11 +10,12 @@ permissions:

jobs:
make-go-tag:
name: Make a vM.m.P tag
name: make a vM.m.P tag
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: checkout repository
uses: actions/checkout@v4

- name: Make go version tag
- name: make go version tag
uses: senzing-factory/github-action-make-go-tag@v1
Loading