diff --git a/.github/workflows/go_app_pull_requests.yml b/.github/workflows/go_app_pull_requests.yml index cceed00..11b579a 100644 --- a/.github/workflows/go_app_pull_requests.yml +++ b/.github/workflows/go_app_pull_requests.yml @@ -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. @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/go_app_push_main.yml b/.github/workflows/go_app_push_main.yml index 84d40d3..eb790ba 100644 --- a/.github/workflows/go_app_push_main.yml +++ b/.github/workflows/go_app_push_main.yml @@ -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: # @@ -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. diff --git a/.github/workflows/go_lib_pull_requests.yml b/.github/workflows/go_lib_pull_requests.yml index a10c4b9..ebe5cca 100644 --- a/.github/workflows/go_lib_pull_requests.yml +++ b/.github/workflows/go_lib_pull_requests.yml @@ -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. @@ -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: @@ -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 ./..." diff --git a/.github/workflows/go_lib_push_main.yml b/.github/workflows/go_lib_push_main.yml index 84d40d3..eb790ba 100644 --- a/.github/workflows/go_lib_push_main.yml +++ b/.github/workflows/go_lib_push_main.yml @@ -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: # @@ -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. diff --git a/.github/workflows/gradle_app_pull_request.yml b/.github/workflows/gradle_app_pull_request.yml index e14400a..d1bdbe2 100644 --- a/.github/workflows/gradle_app_pull_request.yml +++ b/.github/workflows/gradle_app_pull_request.yml @@ -2,10 +2,8 @@ # File: ./.github/workflows/pull_requests.yml # name: Pull Request - on: workflow_call: - jobs: commitlint: # @@ -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} diff --git a/.github/workflows/gradle_jvm_app_pull_requests.yml b/.github/workflows/gradle_jvm_app_pull_requests.yml index f9e7fc3..c948661 100644 --- a/.github/workflows/gradle_jvm_app_pull_requests.yml +++ b/.github/workflows/gradle_jvm_app_pull_requests.yml @@ -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. diff --git a/.github/workflows/gradle_jvm_app_push_main.yml b/.github/workflows/gradle_jvm_app_push_main.yml index 84d40d3..eb790ba 100644 --- a/.github/workflows/gradle_jvm_app_push_main.yml +++ b/.github/workflows/gradle_jvm_app_push_main.yml @@ -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: # @@ -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. diff --git a/.github/workflows/php_lib_pull_requests.yml b/.github/workflows/php_lib_pull_requests.yml index 0d9a60c..6031eba 100644 --- a/.github/workflows/php_lib_pull_requests.yml +++ b/.github/workflows/php_lib_pull_requests.yml @@ -1,5 +1,4 @@ name: Pull Request - on: workflow_call: inputs: @@ -23,7 +22,6 @@ on: COMPOSER_AUTH: description: 'Auth JSON for Composer' required: true - jobs: commitlint: # @@ -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 diff --git a/.github/workflows/php_lib_push_main.yml b/.github/workflows/php_lib_push_main.yml index 84d40d3..eb790ba 100644 --- a/.github/workflows/php_lib_push_main.yml +++ b/.github/workflows/php_lib_push_main.yml @@ -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: # @@ -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. diff --git a/.github/workflows/ruby_app_pull_requests.yml b/.github/workflows/ruby_app_pull_requests.yml index 635d44a..28873a0 100644 --- a/.github/workflows/ruby_app_pull_requests.yml +++ b/.github/workflows/ruby_app_pull_requests.yml @@ -1,5 +1,4 @@ name: Pull Request - on: workflow_call: inputs: @@ -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: # @@ -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 diff --git a/.github/workflows/ruby_app_push_main.yml b/.github/workflows/ruby_app_push_main.yml index 84d40d3..eb790ba 100644 --- a/.github/workflows/ruby_app_push_main.yml +++ b/.github/workflows/ruby_app_push_main.yml @@ -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: # @@ -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.