Skip to main content

CIProvider

Trait CIProvider 

Source
pub trait CIProvider: Send + Sync {
    // Required methods
    fn detect() -> Option<Self>
       where Self: Sized;
    fn context(&self) -> &CIContext;
    fn changed_files<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PathBuf>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create_check<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<CheckHandle>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_check<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        handle: &'life1 CheckHandle,
        summary: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn complete_check<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        handle: &'life1 CheckHandle,
        report: &'life2 PipelineReport,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn upload_report<'life0, 'life1, 'async_trait>(
        &'life0 self,
        report: &'life1 PipelineReport,
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for CI/CD provider integrations.

Implementations provide platform-specific functionality for:

  • Detecting the CI environment
  • Finding changed files
  • Creating and updating check runs/statuses
  • Uploading reports

Required Methods§

Source

fn detect() -> Option<Self>
where Self: Sized,

Detect if running in this CI environment.

Returns Some(Self) if the current environment matches this provider, None otherwise.

Source

fn context(&self) -> &CIContext

Get normalized CI context.

Source

fn changed_files<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<PathBuf>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get files changed in this build.

For PRs, this returns files changed relative to the base branch. For pushes, this returns files changed in the pushed commits.

Source

fn create_check<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<CheckHandle>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a check/status for a project pipeline.

Source

fn update_check<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, handle: &'life1 CheckHandle, summary: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Update check with progress summary.

Source

fn complete_check<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, handle: &'life1 CheckHandle, report: &'life2 PipelineReport, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Complete check with final report (renders to provider-specific format).

Source

fn upload_report<'life0, 'life1, 'async_trait>( &'life0 self, report: &'life1 PipelineReport, ) -> Pin<Box<dyn Future<Output = Result<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Upload report artifact, return URL if available.

Implementors§