Skip to content
Open
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
20 changes: 7 additions & 13 deletions .github/workflows/go_app_pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
fetch-depth: 0
# setup node, needed to lint commits.
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 18
# Install needed libraries to lint commits.
Expand All @@ -54,8 +54,7 @@ jobs:
env:
TOKEN: ${{ secrets.GH_CI_PAT }}
GITHUB_USERNAME: kochava-ci
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf
"https://github.com"
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf "https://github.com"
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down Expand Up @@ -84,20 +83,16 @@ jobs:
env:
TOKEN: ${{ secrets.GH_CI_PAT }}
GITHUB_USERNAME: ${{ inputs.GH_CI_USER }}
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf
"https://github.com"
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf "https://github.com"
# Vendor Go code for ever Go module.
- name: go mod vendor
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname
| xargs -n1 -I{} bash -c "pushd {}; go mod vendor"
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname | xargs -n1 -I{} bash -c "pushd {}; go mod vendor"
# Go vet every Go module.
- name: go vet
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname
| xargs -n1 -I{} bash -c "pushd {}; go vet ./..."
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname | xargs -n1 -I{} bash -c "pushd {}; go vet ./..."
# Run unit test for evet Go module.
- name: go test
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname
| xargs -n1 -I{} bash -c "pushd {}; go test -mod=vendor --race -v ./..."
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname | xargs -n1 -I{} bash -c "pushd {}; go test -mod=vendor --race -v ./..."
docker-build:
#
# ensures the docker image will build without pushing to the registry
Expand All @@ -118,8 +113,7 @@ jobs:
env:
TOKEN: ${{ secrets.GH_CI_PAT }}
GITHUB_USERNAME: ${{ inputs.GH_CI_USER }}
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf
"https://github.com"
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf "https://github.com"
# Vendor Go code needed to build app.
- name: go mod vendor
run: go mod vendor
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/go_app_push_main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Create Github Release

on:
workflow_call:
secrets:
GH_CI_PAT:
description: 'Token password for GitHub auth'
required: true

jobs:
release:
#
Expand All @@ -20,7 +18,7 @@ jobs:
uses: actions/checkout@v3
# Setup Node needed to create release.
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 18
# Add plugin to make the changelog for the release.
Expand Down
17 changes: 6 additions & 11 deletions .github/workflows/go_lib_pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
with:
fetch-depth: 0
# setup node, needed to lint commits.
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 18
# Install needed libraries to lint commits.
Expand All @@ -54,8 +54,7 @@ jobs:
env:
TOKEN: ${{ secrets.GH_CI_PAT }}
GITHUB_USERNAME: kochava-ci
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf
"https://github.com"
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf "https://github.com"
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down Expand Up @@ -84,17 +83,13 @@ jobs:
env:
TOKEN: ${{ secrets.GH_CI_PAT }}
GITHUB_USERNAME: ${{ inputs.GH_CI_USER }}
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf
"https://github.com"
run: git config --global url."https://${GITHUB_USERNAME}:${TOKEN}@github.com".insteadOf "https://github.com"
# Vendor Go code for ever Go module.
- name: go mod vendor
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname
| xargs -n1 -I{} bash -c "pushd {}; go mod vendor"
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname | xargs -n1 -I{} bash -c "pushd {}; go mod vendor"
# Go vet every Go module.
- name: go vet
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname
| xargs -n1 -I{} bash -c "pushd {}; go vet ./..."
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname | xargs -n1 -I{} bash -c "pushd {}; go vet ./..."
# Run unit test for evet Go module.
- name: go test
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname
| xargs -n1 -I{} bash -c "pushd {}; go test -mod=vendor --race -v ./..."
run: find . -name vendor -prune -o -name go.mod -print | xargs -n1 dirname | xargs -n1 -I{} bash -c "pushd {}; go test -mod=vendor --race -v ./..."
4 changes: 1 addition & 3 deletions .github/workflows/go_lib_push_main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Create Github Release

on:
workflow_call:
secrets:
GH_CI_PAT:
description: 'Token password for GitHub auth'
required: true

jobs:
release:
#
Expand All @@ -20,7 +18,7 @@ jobs:
uses: actions/checkout@v3
# Setup Node needed to create release.
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 18
# Add plugin to make the changelog for the release.
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/gradle_app_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
# File: ./.github/workflows/pull_requests.yml
#
name: Pull Request

on:
workflow_call:

jobs:
commitlint:
#
Expand All @@ -16,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install --save-dev @commitlint/{config-conventional,cli}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle_jvm_app_pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
fetch-depth: 0
# setup node, needed to lint commits.
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 18
# Install needed libraries to lint commits.
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/gradle_jvm_app_push_main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Create Github Release

on:
workflow_call:
secrets:
GH_CI_PAT:
description: 'Token password for GitHub auth'
required: true

jobs:
release:
#
Expand All @@ -20,7 +18,7 @@ jobs:
uses: actions/checkout@v3
# Setup Node needed to create release.
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 18
# Add plugin to make the changelog for the release.
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/php_lib_pull_requests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Pull Request

on:
workflow_call:
inputs:
Expand All @@ -23,7 +22,6 @@ on:
COMPOSER_AUTH:
description: 'Auth JSON for Composer'
required: true

jobs:
commitlint:
#
Expand All @@ -36,14 +34,13 @@ jobs:
with:
fetch-depth: 0
# setup node, needed to lint commits.
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 18
# Install needed libraries to lint commits.
- run: npm install --save-dev @commitlint/{config-conventional,cli}
# Lint the commits.
- run: npx commitlint --from=${{ github.event.pull_request.base.sha }}

test:
#
# ensure php standards and tests pass
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/php_lib_push_main.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Create Github Release

on:
workflow_call:
secrets:
GH_CI_PAT:
description: 'Token password for GitHub auth'
required: true

jobs:
release:
#
Expand All @@ -20,7 +18,7 @@ jobs:
uses: actions/checkout@v3
# Setup Node needed to create release.
- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 18
# Add plugin to make the changelog for the release.
Expand Down
106 changes: 47 additions & 59 deletions .github/workflows/ruby_app_pull_requests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Pull Request

on:
workflow_call:
inputs:
Expand Down Expand Up @@ -32,15 +31,13 @@ on:
DATABASE_PASSWORD:
description: 'Database password for Postgres/Rails services'
required: true

env:
DATABASE_ADAPTER: ${{ inputs.DATABASE_ADAPTER }}
DATABASE_NAME: ${{ inputs.DATABASE_NAME }}
DATABASE_USERNAME: ${{ inputs.DATABASE_USERNAME }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
DATABASE_HOST: ${{ inputs.DATABASE_HOST }}
SQL_PATH: ${{ inputs.SQL_PATH }}

jobs:
commitlint:
#
Expand All @@ -53,68 +50,59 @@ jobs:
with:
fetch-depth: 0
# setup node, needed to lint commits.
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
node-version: 18
# Install needed libraries to lint commits.
- run: npm install --save-dev @commitlint/{config-conventional,cli}
# Lint the commits.
- run: npx commitlint --from=${{ github.event.pull_request.base.sha }}

test:
#
# ensure ruby standards and tests pass
#
runs-on: ubuntu-latest

services:
database:
image: postgres:12.3
env:
POSTGRES_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
ports:
- 5432:5432

redis:
image: redis:5.0.7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.6
ports:
- 9200:9200

steps:
# Checkout ruby code to test.
- name: Checkout repo
uses: actions/checkout@v3
# Setup Ruby, by default uses .ruby-version file.
- name: Setup up Ruby
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
with:
bundler-cache: true
# Install rails libraries.
- name: Install dependencies
run: bundle install
# Create database.
- name: Create database
run: psql -h $DATABASE_HOST -U $DATABASE_USERNAME -c 'CREATE DATABASE "${{ env.DATABASE_NAME }}";'
env:
PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }}
# Setup database.
- name: Prepare test database
run: psql -h $DATABASE_HOST -U $DATABASE_USERNAME -d $DATABASE_NAME < $SQL_PATH
env:
PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }}
- name: Run tests
run: bundle exec rspec spec

#
# ensure ruby standards and tests pass
#
runs-on: ubuntu-latest
services:
database:
image: postgres:12.3
env:
POSTGRES_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
ports:
- 5432:5432
redis:
image: redis:5.0.7
options: >-
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 6379:6379
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.8.6
ports:
- 9200:9200
steps:
# Checkout ruby code to test.
- name: Checkout repo
uses: actions/checkout@v3
# Setup Ruby, by default uses .ruby-version file.
- name: Setup up Ruby
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
with:
bundler-cache: true
# Install rails libraries.
- name: Install dependencies
run: bundle install
# Create database.
- name: Create database
run: psql -h $DATABASE_HOST -U $DATABASE_USERNAME -c 'CREATE DATABASE "${{ env.DATABASE_NAME }}";'
env:
PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }}
# Setup database.
- name: Prepare test database
run: psql -h $DATABASE_HOST -U $DATABASE_USERNAME -d $DATABASE_NAME < $SQL_PATH
env:
PGPASSWORD: ${{ secrets.DATABASE_PASSWORD }}
- name: Run tests
run: bundle exec rspec spec
docker-build:
#
# ensures the docker image will build without pushing to the registry
Expand Down
Loading