Published
Edited
Sep 21, 2021
25 forks
47 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
repo = "sveltejs/svelte"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
isSample = repo === "sveltejs/svelte" && !hasApiKey
Insert cell
// Once authenticated:
// workflows = fetchWorkflows(repo)
workflows = isSample ? sampleWorkflows : fetchWorkflows(repo)
Insert cell
// Once authenticated:
// runs = fetchRuns(repo, workflow.id)
runs = isSample ? sampleRuns : fetchRuns(repo, workflow.id)
Insert cell
branches = new Set(runs.map(r => r.head_branch))
Insert cell
Insert cell
jobs = parseJobs(runs)
.filter((job) => !branch || job.run.head_branch === branch) // filter to the selected branch
// Determine which jobs should be considered "integration tests" by defining filtering criteria below
.filter((job) => {
// For example you could filter on the name of the job:
// return job.name.indexOf("Test") >= 0
// by default we visualize all of the jobs
return true
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
prettyConclusion = (d) => {
if(d == "success") return "✅ success"
if(d == "failure") return "⛔️ failure"
if(d == "cancelled") return "⬜️ cancelled"
return d
}
Insert cell
color = ({domain: ["cancelled", "failure", "success"], range: ["gray", "#cb2431", "#2cbe4e"]})
Insert cell
timeParser = d3.timeParse("%Y-%m-%dT%H:%M:%S%Z")
Insert cell
timeFormat = d3.timeFormat("%a %m/%d %I:%M")
Insert cell
Insert cell
Insert cell
import {fetchWorkflows, fetchRuns, parseJobs, sampleWorkflows, sampleRuns, rateLimitSummary, hasApiKey, apiKeyStatus} from "@observablehq/github-actions-workflows-api"
Insert cell
Plot = require("@observablehq/plot@0.1").then(addTooltip)
Insert cell
import {addTooltip} from "@fil/experimental-plot-tooltip-01"
Insert cell
import {toc} from "@observablehq/templates-table-of-instructions"
Insert cell
// For a notebook to access Secrets, it must statically reference one; this cell grants Secret access to the notebook from which we import the GitHub API helpers. `undefined` stops the Secret from appearing in the Inspector.
undefined && Secret("GITHUB_ACCESS_TOKEN")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more