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
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Auto-detects your coverage artifact files and CI environment to post to [Coveral
### Linux

#### x86_64

To install the generic Linux binary (`x86_64`):

```bash
Expand Down Expand Up @@ -178,7 +179,6 @@ Usage: coveralls done [options]
SSL_CERT_FILE=/etc/pki/tls/cert.pem
```


## Built-In Support

### Supported Coverage Report Formats
Expand Down Expand Up @@ -212,6 +212,7 @@ You can add a report parser to this project by following [these instructions](./
- Drone
- Buildkite
- Xcode Cloud
- RWX

[Docs on environment variables for other CI support.](https://docs.coveralls.io/ci-services#option-1-use-common-environment-variables)

Expand Down Expand Up @@ -295,6 +296,7 @@ Brief description: new coverage report support

[After the release is available][github-releases], see [Homebrew
release](#homebrew-release) instructions.

#### Manual

1. Bump version in [`src/coverage_reporter.cr`](./src/coverage_reporter.cr) and [`shard.yml`](./shard.yml)
Expand All @@ -307,6 +309,7 @@ available][github-releases], see [Homebrew release](#homebrew-release)
instructions.

[github-releases]: https://github.com/coverallsapp/coverage-reporter/releases

#### Homebrew release

In the [homebrew-coveralls repo][homebrew], a new PR will automatically get
Expand Down
27 changes: 27 additions & 0 deletions spec/coverage_reporter/config_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -613,5 +613,32 @@
})
end
end

context "for RWX" do
before_each do
ENV["RWX"] = "true"
ENV["RWX_GIT_REPOSITORY_NAME"] = "rwx/repo"
ENV["RWX_RUN_ID"] = "12345"
ENV["RWX_TASK_ID"] = "6789"
ENV["RWX_GIT_REF_NAME"] = "main"
ENV["RWX_RUN_URL"] = "https://cloud.rwx.com/runs/12345"
ENV["RWX_TASK_URL"] = "https://cloud.rwx.com/tasks/6789"
ENV["RWX_TASK_ATTEMPT_NUMBER"] = "3"
ENV["RWX_GIT_COMMIT_SHA"] = "rwx-commit-sha"
end

it "provides custom options" do
expect(subject).to eq({

Check failure on line 631 in spec/coverage_reporter/config_spec.cr

View workflow job for this annotation

GitHub Actions / test (macos-latest)

expected: {:repo_token => "repo_token", :service_name => "rwx", :service_number => "12345", :service_job_id => "6789", :service_branch => "main", :commit_sha => "rwx-commit-sha", :service_build_url => "https://cloud.rwx.com/runs/12345", :service_job_url => "https://cloud.rwx.com/tasks/6789"}
:repo_token => repo_token,
:service_name => "rwx",
:service_number => "12345",
:service_job_id => "6789",
:service_branch => "main",
:commit_sha => "rwx-commit-sha",
:service_build_url => "https://cloud.rwx.com/runs/12345",
:service_job_url => "https://cloud.rwx.com/tasks/6789",
})
end
end
end
end
25 changes: 25 additions & 0 deletions src/coverage_reporter/ci/rwx.cr
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require "./options"

module CoverageReporter
module CI
module Rwx
extend self

def options
return unless ENV["RWX"]?

Options.new(
service_name: "rwx",
repo_name: ENV["RWX_GIT_REPOSITORY_NAME"]?,
service_number: ENV["RWX_RUN_ID"]?,
service_job_id: ENV["RWX_TASK_ID"]?,
service_branch: ENV["RWX_GIT_REF_NAME"]?,
service_build_url: ENV["RWX_RUN_URL"]?,
service_job_url: ENV["RWX_TASK_URL"]?,
service_attempt: ENV["RWX_TASK_ATTEMPT_NUMBER"]?,
commit_sha: ENV["RWX_GIT_COMMIT_SHA"]?,
).to_h
end
end
end
end
1 change: 1 addition & 0 deletions src/coverage_reporter/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module CoverageReporter
CI::Wercker,
CI::Drone,
CI::XcodeCloud,
CI::Rwx,
CI::Local,
}

Expand Down
Loading