# swiftlang/github-workflows architecture

> Architecture diagram of the GitHub repository swiftlang/github-workflows, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/swiftlang/github-workflows
- Repository: https://github.com/swiftlang/github-workflows

## Overview

##### Main Components

a) Workflow Categories Layer
- Soundness Workflows
- Testing Workflows
- Future Workflows (like macOS support, marked as planned)

b) Integration Layer
- GitHub Actions Runner Infrastructure
- Local Testing Infrastructure (Act)

c) Execution Environment Layer
- Linux Environment
- Windows Environment
- Future macOS Environment

##### Key Relationships

- How consumer repositories integrate with these workflows
- How workflows interact with different execution environments
- How various checks and tests are orchestrated

##### Specific Implementation Details

**┌─ Consumer Repositories Layer ─────────────────────┐**

- Swift Package Repos    Swift Compiler Repos     │

- ┼──────────────────────┼────────────────┘

**┌─ Workflow Integration Layer ───┼────────────────┐**

- ┌──────▼──────────┐   ┌──────▼──────────┐     │
- Soundness     │   │     Testing     │     │
- Workflow      │   │    Workflow     │     │
- ┬──────────┘   └──────┬──────────┘     │

- ┼──────────────────────┼────────────────┘

**┌─ Checks & Tests Layer ────────┼────────────────┐**
- ┌────▼───────────────┐     │                │
- License Headers  │     │                │
- Formatting      │     │                │
- Symlinks       │  ┌───▼──────────┐     │
- Documentation  │  │ Swift Tests  │     │
- YAML Lint     │  │ (Multiple    │     │
- ┘   │  Versions)   │     │
- ┘      │
- ┘

**┌─ Execution Environments ──────────────────────────┐**

- Linux         Windows        macOS (Future)   │

- ┘

##### Important Details to Capture

- Version Support Matrix:
- Swift versions (5.8, 5.9, 5.10, 6.0, nightly)
- Platform-specific exclusions

- Integration Points:
- Local testing with Act
- GitHub Actions integration
- Pre-build command support

##### Additional Recommendations

- Annotations for configuration options
- Error/feedback paths
- Version compatibility matrix as a supplementary element

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Consumer
        SwiftPkg[Swift Package Repos]
        SwiftComp[Swift Compiler Repos]
    end

    subgraph WorkflowLayer
        Soundness["Soundness Workflow"]
        Testing["Testing Workflow"]
        PR["Pull Request Workflow"]
    end

    subgraph ChecksLayer
        License["License Headers Check"]
        Format["Formatting Check"]
        Symlinks["Symlinks Check"]
        Docs["Documentation Check"]
        YAMLLint["YAML Lint"]
        SwiftTest["Swift Tests"]
    end

    subgraph Environments
        Linux["Linux Environment"]
        Windows["Windows Environment"]
        MacOS["macOS Environment (Future)"]:::future
    end

    subgraph Infrastructure
        TestInfra["Testing Infrastructure"]
        GHRunner["GitHub Actions Runner"]
        LicenseConfig["License Configuration"]
        WinSetup["Windows Setup"]
        SwiftVer["Swift Version Management"]
    end

    %% Relationships
    SwiftPkg --> WorkflowLayer
    SwiftComp --> WorkflowLayer
    
    Soundness --> License
    Soundness --> Format
    Soundness --> Symlinks
    Soundness --> Docs
    Soundness --> YAMLLint
    
    Testing --> SwiftTest
    PR --> Soundness
    PR --> Testing
    
    License --> Infrastructure
    Format --> Infrastructure
    Symlinks --> Infrastructure
    Docs --> Infrastructure
    YAMLLint --> Infrastructure
    SwiftTest --> Infrastructure
    
    Infrastructure --> Linux
    Infrastructure --> Windows
    Infrastructure -.-> MacOS
    
    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef future fill:#f0f0f0,stroke:#666,stroke-width:1px,stroke-dasharray: 5 5
    classDef workflow fill:#d4edda,stroke:#28a745
    classDef check fill:#fff3cd,stroke:#ffc107
    classDef infra fill:#cce5ff,stroke:#0d6efd
    classDef env fill:#e2e3e5,stroke:#6c757d
    
    class Soundness,Testing,PR workflow
    class License,Format,Symlinks,Docs,YAMLLint,SwiftTest check
    class TestInfra,GHRunner,LicenseConfig,WinSetup,SwiftVer infra
    class Linux,Windows,MacOS env
    class MacOS future

    %% Click Events
    click Soundness "https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/soundness.yml"
    click Testing "https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/swift_package_test.yml"
    click PR "https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/pull_request.yml"
    click License "https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/scripts/check-license-header.sh"
    click Format "https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/scripts/check-swift-format.sh"
    click Symlinks "https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/scripts/check-broken-symlinks.sh"
    click Docs "https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/scripts/check-docs.sh"
    click YAMLLint "https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/configs/yamllint.yml"
    click WinSetup "https://github.com/swiftlang/github-workflows/blob/main/.github/workflows/scripts/windows/install-vsb.ps1"
    click SwiftVer "https://github.com/swiftlang/github-workflows/tree/main/.github/workflows/scripts/windows/swift/"
    click LicenseConfig "https://github.com/swiftlang/github-workflows/blob/main/.license_header_template"
    click TestInfra "https://github.com/swiftlang/github-workflows/tree/main/tests/"
```
