-
-
Notifications
You must be signed in to change notification settings - Fork 14
ci: replace archived codeclimate-action with qlty-action #49
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,9 @@ on: | |
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| strategy: | ||
| matrix: | ||
| ruby-version: ['2.7', '3.0', '3.1', '3.2', '3.3'] | ||
|
|
@@ -52,13 +55,14 @@ jobs: | |
| TEST_CHECK_EXISTENCE_PARENT_FOLDER_ID: "${{ secrets.TEST_CHECK_EXISTENCE_PARENT_FOLDER_ID }}" | ||
| TEST_CHECK_EXISTENCE_FILE_TITLE: "${{ vars.TEST_CHECK_EXISTENCE_FILE_TITLE }}" | ||
| TEST_CHECK_EXISTENCE_FOLDER_TITLE: "${{ vars.TEST_CHECK_EXISTENCE_FOLDER_TITLE }}" | ||
| # https://github.com/simplecov-ruby/simplecov#json-formatter | ||
| CC_TEST_REPORTER_ID: "${{ secrets.CC_TEST_REPORTER_ID }}" | ||
|
|
||
| - uses: paambaati/codeclimate-action@v9.0.0 | ||
| - name: Upload coverage to Qlty Cloud | ||
| uses: qltysh/qlty-action/coverage@v2 | ||
| if: matrix.ruby-version == '3.1' | ||
| env: | ||
| CC_TEST_REPORTER_ID: "${{ secrets.CC_TEST_REPORTER_ID }}" | ||
| with: | ||
| oidc: true | ||
| files: coverage/coverage.json | ||
| format: simplecov | ||
|
Comment on lines
+59
to
+65
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 Result: The default behavior of qltysh/qlty-action/coverage@v2 when upload/auth fails is to fail the GitHub Action step, causing the CI workflow to fail. This is evidenced by GitHub issue Citations:
🏁 Script executed: # First, let's examine the actual workflow file to see the current state
cat -n .github/workflows/rubygems.yml | sed -n '59,65p'Repository: bskim45/fastlane-plugin-google_drive Length of output: 361 🏁 Script executed: # Check if there's any documentation or action.yml in the repo related to qlty-action
find . -type f -name "*.yml" -o -name "*.yaml" -o -name "action.yml" | xargs grep -l "qlty" 2>/dev/null | head -20Repository: bskim45/fastlane-plugin-google_drive Length of output: 112 🌐 Web query:
💡 Result: The qltysh/qlty-action/coverage@v2 GitHub Action is a reusable action for uploading code coverage data to Qlty Cloud. It requires a free Qlty Cloud account. Usage example from official Qlty documentation: - uses: qltysh/qlty-action/coverage@v2 with: oidc: true files: coverage/lcov.info Or with token: - uses: qltysh/qlty-action/coverage@v2 with: token: ${{ secrets.QLTY_COVERAGE_TOKEN }} files: coverage/lcov.info The skip-errors input is shown in a real-world usage example from GitHub issue Citations:
🌐 Web query:
💡 Result: The default value for the 'skip-errors' input in qltysh/qlty-action's action.yml is false. This input is used in the qltysh/qlty-action/coverage action to control whether to skip errors during coverage upload (e.g., parsing failures). It is explicitly set to skip-errors: false in usage examples from issue reports. Citations: 🌐 Web query:
💡 Result: skip-errors is not a recognized GitHub Actions feature. The standard mechanism for handling errors without halting execution is continue-on-error: true, available at both job and step levels. Key differences and behaviors from official documentation and community sources: - Step level (jobs.<job_id>.steps[*].continue-on-error): When true, a step failure does not fail the job. The step's outcome remains 'failure' (accessible via steps.<step_id>.outcome), but conclusion is 'success'. Subsequent steps run normally. The job shows as failed if any non-continued step fails. Use for non-critical steps like optional coverage checks or notifications, where you want to upload artifacts/logs despite failure. Example: - name: Optional check id: check continue-on-error: true run: exit 1 - name: Upload if failed if: steps.check.outcome == 'failure' run: echo "Failed but continuing" - Job level (jobs.<job_id>.continue-on-error): When true, a job failure does not fail the workflow. The job shows as failed (red X), but dependent jobs (via needs) can run if their if allows (e.g., if: always). Use for experimental matrix jobs. Example for matrix: test: continue-on-error: ${{ matrix.experimental }} strategy: matrix: experimental: [true, false] For workflow reliability best practices: - Prefer if: success || failure or if: !cancelled on cleanup/upload steps over continue-on-error at step level. This runs always (except cancel), keeps failure visible, no special outcome checking needed. Sources confirm this shows correct failure status while continuing. - For matrices: strategy.fail-fast: false + no continue-on-error lets all jobs run, workflow fails if any does (preferred for full visibility). - Use steps..outcome to check true failure after continue-on-error. - Avoid overusing continue-on-error as it can mask issues; combine with notifications (e.g., PR comments on failure). - Set timeout-minutes and retry for resilience. This ensures reliability: failures are visible, workflows continue for cleanup/completeness, no silent ignores. Citations:
Make coverage upload explicitly non-blocking (per PR objective). On lines 59-65, this step can still fail the job when Qlty Cloud/OIDC/project setup is incomplete. The action defaults to failing on errors (skip-errors defaults to false), so add a hard non-blocking guard at the GitHub Actions level and skip when the coverage artifact is missing. Proposed workflow hardening - name: Upload coverage to Qlty Cloud
uses: qltysh/qlty-action/coverage@v2
- if: matrix.ruby-version == '3.1'
+ if: matrix.ruby-version == '3.1' && hashFiles('coverage/coverage.json') != ''
+ continue-on-error: true
with:
oidc: true
files: coverage/coverage.json
format: simplecov🤖 Prompt for AI Agents |
||
|
|
||
| build_and_publish: | ||
| name: Build and Publish | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow uploads
coverage/coverage.json, but the repo’s SimpleCov setup (spec/spec_helper.rb) only callsSimpleCov.startand does not configure the JSON formatter, socoverage/coverage.jsonis unlikely to be generated. Either update the SimpleCov configuration to emitcoverage/coverage.jsonviasimplecov_json_formatter, or pointfiles:at the SimpleCov output file that is actually produced (e.g.,.resultset.jsonif that’s what Qlty expects forformat: simplecov).