from Xcode Cloud and GHA 📈 Dashboard plots and displays metrics 💡 Inspired by a real-world system 📦 Swift Package monorepo 🆓 Everything is Open Source! ❤
writing tooling 🚀 Powerful language with a mature ecosystem. ➕ Beyond Apple app development 📈 Tools are often maintained and built by mobile developers. ❤ Focus on the system, not the language!
# Move into the new directory cd metrics # Create a new executable package swift package init -- name Metrics Creating a Swift Package Creating a Swift Package
│ └── Metrics.swift └── Tests └── MetricsTests └── MetricsTests.swift Creating a Swift Package Creating a Swift Package # ! /bin/sh # Create an empty directory mkdir metrics # Move into the new directory cd metrics # Create a new executable package swift package init -- name Metrics
xcodeCloud = "xcode-cloud" case githubActions = "github-actions" } enum Outcome: String, Codable { case success case failure case cancelled } final class Metric: Model, Content { static let schema = "metrics" @ID(key: .id) var id: UUID? @Field(key: "workflow") var workflow: String @Field(key: "duration") var duration: Int @Field(key: "date") var date: Date @Field(key: "repository") var repository: String @Field(key: "author") var author: String @Enum(key: "provider") var provider: Provider @Enum(key: "outcome") var outcome: Outcome init() {} } Modelling data . ├── Package.swift ├── README.md ├── Sources │ └── App │ └── Model.swift
Send metric points to the metrics service. • Straight after the work fl ow’s execution is done. • No back-end service • A work fl ow using the work fl ow_run event • Run a Swift CLI 🚀 GitHub Actions Metrics
🍎 An API using Vapor 💻 A command line tool for macOS, extensible to other platforms too! 🔗 A serverless Swift lambda using AWS 📦 Everything in the same Swift Package! ❤ Swift is great for developer tooling! 🤔 Great way to upskill!