Skip to content
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
16 changes: 0 additions & 16 deletions .codeclimate.yml

This file was deleted.

146 changes: 68 additions & 78 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -1,101 +1,91 @@
name: Github Testing
on: [push]

permissions:
contents: read
id-token: write

jobs:
bundle_audit:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.2
- name: config bundler
run: |
bundle config set deployment 'false'
bundle env
head -n1 $(which bundle)
- name: Install dependencies
run: |
bundle install --jobs 4 --retry 3
- name: Install bundle-audit
run: gem install bundle-audit
- name: Bundle Audit Check
run: gem exec bundle-audit check --update

test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
ruby: [ 2.7 ]
os: [ubuntu-24.04]
ruby: ['3.2.2']
runs-on: ${{ matrix.os }}
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
steps:
env:
RAILS_ENV: test
COVERAGE: true
DISABLE_SPRING: 1

- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: config bundler
run: |
bundle config set without 'development staging production'
bundle config set deployment '[secure]'
bundle env
head -n1 $(which bundle)
steps:
- uses: actions/checkout@v5

- name: Set ENV for codeclimate (pull_request)
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/$GITHUB_HEAD_REF:refs/remotes/origin/$GITHUB_HEAD_REF
echo "GIT_BRANCH=$GITHUB_HEAD_REF" >> $GITHUB_ENV
echo "GIT_COMMIT_SHA=$(git rev-parse origin/$GITHUB_HEAD_REF)" >> $GITHUB_ENV
if: github.event_name == 'pull_request'
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}

- name: Set ENV for codeclimate (push)
run: |
echo "GIT_BRANCH=$GITHUB_REF" >> $GITHUB_ENV
echo "GIT_COMMIT_SHA=$GITHUB_SHA" >> $GITHUB_ENV
if: github.event_name == 'push'
- name: config bundler
run: |
bundle config set deployment 'false'
bundle env
head -n1 $(which bundle)

- name: Prepare CodeClimate
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
curl -LSs 'https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64' >./cc-test-reporter;
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
- name: Install dependencies
run: |
bundle install --jobs 4 --retry 3

- name: Run Tests
env:
RAILS_ENV: test
COVERAGE: true
DISABLE_SPRING: 1
run: |
gem install bundler -v '>= 2.2.10'
gem install simplecov -v '<= 0.17.1'
gem install builder
gem install nokogiri -v '~> 1.11.3'
gem install savon
gem install webmock
gem install mocha
gem install minitest -v '~> 5.14'
bundle install
rake
- name: Save coverage
run: ./cc-test-reporter format-coverage --output coverage/codeclimate.${{ matrix.ruby }}.json
- name: Run Tests
run: rake

- uses: actions/upload-artifact@v3.1.3
with:
name: coverage-${{ matrix.ruby }}
path: coverage/codeclimate.${{ matrix.ruby }}.json
- name: Setup qlty.sh
run: |
curl -sSL https://qlty.sh/install.sh | bash
export PATH="$HOME/.qlty/bin:$PATH"
qlty --version

upload_coverage:
strategy:
matrix:
os: [ ubuntu-20.04 ]
ruby: [ '2.7' ]
runs-on: ubuntu-20.04
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CC_TEST_REPORTER_URL: https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
- name: Initialize qlty.sh
run: |
export PATH="$HOME/.qlty/bin:$PATH"
qlty init --no

needs: test
- name: Run qlty.sh analysis
run: |
export PATH="$HOME/.qlty/bin:$PATH"
qlty check

steps:
- name: Download test coverage reporter
run: curl -L $CC_TEST_REPORTER_URL > cc-test-reporter
- name: Upload coverage to qlty.sh
uses: qltysh/qlty-action/coverage@v2
with:
oidc: true
files: coverage/.resultset.json

- name: Give test coverage reporter executable permissions
run: chmod +x cc-test-reporter
- uses: actions/upload-artifact@v4
with:
name: qlty-report-${{ matrix.ruby }}
path: qlty-report.json

- uses: actions/download-artifact@v3.0.2
- uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.ruby }}
path: coverage

- name: Aggregate & upload results to Code Climate
run: |
./cc-test-reporter sum-coverage coverage/codeclimate.*.json
./cc-test-reporter upload-coverage

path: coverage/
7 changes: 7 additions & 0 deletions .qlty/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*
!configs
!configs/**
!hooks
!hooks/**
!qlty.toml
!.gitignore
21 changes: 21 additions & 0 deletions .qlty/configs/.yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
extends: default

rules:
document-start: disable
quoted-strings:
required: only-when-needed
extra-allowed: ["{|}"]
key-duplicates: {}
octal-values:
forbid-implicit-octal: true
line-length: disable
indentation: disable
new-line-at-end-of-file: disable
trailing-spaces: disable
brackets: disable
colons: disable
empty-lines: disable
comments: disable
braces: disable
comments-indentation: disable
commas: disable
89 changes: 89 additions & 0 deletions .qlty/qlty.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# This file was automatically generated by `qlty init`.
# You can modify it to suit your needs.
# We recommend you to commit this file to your repository.
#
# This configuration is used by both Qlty CLI and Qlty Cloud.
#
# Qlty CLI -- Code quality toolkit for developers
# Qlty Cloud -- Fully automated Code Health Platform
#
# Try Qlty Cloud: https://qlty.sh
#
# For a guide to configuration, visit https://qlty.sh/d/config
# Or for a full reference, visit https://qlty.sh/d/qlty-toml
config_version = "0"

exclude_patterns = [
"*_min.*",
"*-min.*",
"*.min.*",
"**/.yarn/**",
"**/*.d.ts",
"**/assets/**",
"**/bower_components/**",
"**/build/**",
"**/cache/**",
"**/config/**",
"**/db/**",
"**/deps/**",
"**/dist/**",
"**/extern/**",
"**/external/**",
"**/generated/**",
"**/Godeps/**",
"**/gradlew/**",
"**/mvnw/**",
"**/node_modules/**",
"**/protos/**",
"**/seed/**",
"**/target/**",
"**/templates/**",
"**/testdata/**",
"**/vendor/**", "bin/", "test/",
]

test_patterns = [
"**/test/**",
"**/spec/**",
"**/*.test.*",
"**/*.spec.*",
"**/*_test.*",
"**/*_spec.*",
"**/test_*.*",
"**/spec_*.*",
]

[smells]
mode = "comment"

[smells.boolean_logic]
threshold = 4

[smells.file_complexity]
threshold = 55

[smells.return_statements]
threshold = 4

[smells.nested_control_flow]
threshold = 4

[smells.function_parameters]
threshold = 4

[smells.function_complexity]
threshold = 5

[smells.duplication]
threshold = 22

[[source]]
name = "default"
default = true

[[plugin]]
name = "rubocop"

[[plugin.fetch]]
url = "https://raw.githubusercontent.com/internetee/style-guide/master/ruby/.rubocop-modern.yml"
path = ".rubocop-modern.yml"
Loading