Skip to content
Merged
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
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: ci

on:
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: the site builds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# Hugo resolves the landingkit module (hugo.toml [module]) with the go
# command, at the version go.mod pins.
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: false
- uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.167.0"
extended: true
- run: hugo --minify
# A portal that builds and leaves an organisation out is a portal nobody
# notices is incomplete. The list is written here, not read from
# hugo.toml: a check that takes its list from the file it checks passes
# whatever the file says.
- name: every member organisation and repository is on it
run: |
rc=0
for org in go-ndarray go-fft go-numerics go-statistics go-dataframe go-plot go-notebook; do
for url in "https://$org.github.io/" "https://$org.github.io/docs/"; do
grep -qF "$url" public/index.html \
|| { echo "::error::$url is not on the page"; rc=1; }
done
done
for repo in go-scikit.github.io brand .github; do
grep -qF "go-scikit/$repo" public/index.html \
|| { echo "::error::go-scikit/$repo is not on the page"; rc=1; }
done
[ $rc -eq 0 ] && echo "the page names every member organisation, its site and docs, and every repository here"
exit $rc

# The hero shows example/first.md and, under it, example/output.txt: what
# running it printed. This runs the notebook again, with the notebook
# command and the library versions example/go.mod pins, and fails if the
# output differs. Timings ("ran in 41µs") and the "kept" marker of a cached
# cell are removed first: they are the only parts that change from run to
# run.
notebook:
name: the notebook prints what the page says
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: example/go.mod
cache-dependency-path: example/go.sum
- name: Run the notebook
working-directory: example
env:
GOWORK: "off"
run: |
set -o pipefail
go tool notebook run first.md > out.raw
sed -E 's/, (ran in [^)]*|kept)\)/)/' out.raw > output.txt
- name: The committed output is the one printed
run: |
if ! git diff --exit-code -- example/output.txt; then
echo "::error::example/output.txt differs from what first.md prints: run it again (see README) and commit the output"
exit 1
fi
96 changes: 96 additions & 0 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Build + deploy the Hugo site to GitHub Pages on every push to main.
# Adapted from the official Hugo template at
# https://gohugo.io/host-and-deploy/host-on-github-pages/.

name: Deploy Hugo site to Pages

on:
push:
branches: [main]
# Build on every pull request too, so a change to the layout, the content or
# the Hugo version has to prove the site still builds before it lands.
# Without this the workflow ran only on main, which meant a dependency bump
# arrived with no signal at all -- its checks read "no checks", which is not
# the same thing as green and must not be merged as if it were.
pull_request:
workflow_dispatch:

# Allow only one concurrent deployment, skipping runs queued between
# the run in-progress and latest queued. Don't cancel in-progress
# runs — we want them to finish before a new build replaces them.
concurrency:
group: "pages"
cancel-in-progress: false

# The build needs nothing beyond the source and the Pages configuration it
# reads to compute the base URL. Publishing rights are granted to the deploy
# job alone, below, so a pull request build cannot replace what is served.
permissions:
contents: read
pages: read

env:
# Pin Hugo so site builds don't break when a new release ships
# incompatible template changes. Bump deliberately, not by
# surprise.
HUGO_VERSION: 0.135.0

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Hugo CLI
run: |
wget -O hugo.deb "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb"
sudo dpkg -i hugo.deb

- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive

- name: Setup Pages
id: pages
uses: actions/configure-pages@v6

# Hugo resolves the landingkit module (hugo.toml [module]) with the go
# command, at the version go.mod pins.
- name: Setup Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: false

- name: Build
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"

- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: ./public

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
# Only main publishes. A pull request stops after build above: it has built
# the site, which is the whole point of the gate, and it has no business
# replacing what is served.
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5
43 changes: 43 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: links

# The landing had a link to https://github.com/go-fileshare/authnd, which is a
# 404: authnd lives in go-authn. A dead link on a landing page breaks nothing
# that complains, so every link of the BUILT site is checked (the layouts hold
# template expressions, not URLs).
#
# The checker is `landingkit links`, run at the version the landing's go.mod
# pins: `go run` without a version inside a module that requires
# github.com/go-fleettools/landingkit uses that requirement, so Renovate's bump
# of the partials bumps the checker with them. It probes github.com blob links
# on raw.githubusercontent.com, because github.com answers a program's request
# for a blob page with 503 most of the time (see the landingkit README).

on:
pull_request:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
links:
name: every link and image resolves
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: false
- uses: peaceiris/actions-hugo@v3
with:
hugo-version: "0.167.0"
extended: true
- run: hugo --minify --destination ./public
- name: Check
env:
GOWORK: "off"
run: go run github.com/go-fleettools/landingkit/cmd/landingkit links public
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
public/
resources/
.hugo_build.lock
.DS_Store
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# go-scikit.github.io
The go-scikit portal: the pure-Go scientific stack, one page

The go-scikit portal (Hugo), served at <https://go-scikit.github.io/>: the
stack, one card per member organisation with its site and documentation, the
measured claims with links to their evidence, and a first notebook.

The design is the go-* family landing kit, imported as the Hugo module
[go-fleettools/landingkit](https://github.com/go-fleettools/landingkit)
(pinned in `go.mod`; `kit.go` keeps `go mod tidy` from dropping it). The only
thing set here is `[params.brand]` in `hugo.toml`, written by
`landingkit brand static/img/logo.svg` from the logo's gradient. The member
organisations, the claims and the repositories are lists in `hugo.toml`; the
page is `layouts/index.html`.

The notebook is real: the hero shows `example/first.md` and, under it,
`example/output.txt`, both read at build time. `example/go.mod` pins the
libraries it imports and the `notebook` command (as a `tool`), and the `ci`
workflow runs it again and fails if the output differs.

```sh
cd example && go tool notebook run first.md | sed -E 's/, (ran in [^)]*|kept)\)/)/' > output.txt
hugo server
```

| Workflow | What |
| --- | --- |
| `hugo.yml` | builds on pull requests; builds and deploys to Pages on `main` |
| `ci.yml` | the site builds and names every member organisation and repository; the notebook prints what the page says |
| `links.yml` | every link and image of the built site resolves (`landingkit links`) |

BSD-3-Clause.
Empty file added content/_index.md
Empty file.
12 changes: 12 additions & 0 deletions example/deps.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//go:build tools

// This file never builds. first.md is a notebook, not Go, so `go mod tidy` --
// which Renovate runs after every bump -- finds nothing here that uses the
// libraries the notebook imports and deletes their requirements. Importing
// them here keeps them, at the versions go.mod pins.
package example

import (
_ "github.com/go-ndarray/ndarray/random"
_ "github.com/go-statistics/stats"
)
20 changes: 20 additions & 0 deletions example/first.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# A first notebook

```go
import (
"github.com/go-ndarray/ndarray/random"
"github.com/go-statistics/stats"
)
```

A thousand draws from seed 42: the
numbers NumPy's `default_rng(42)` gives.

```go
rng := random.DefaultRNG(42)
x, _ := stats.Normal{Loc: 10, Scale: 2}.Rvs(rng, 1000)
```

```go
stats.Percentiles(x, []float64{25, 50, 75}, nil)
```
26 changes: 26 additions & 0 deletions example/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module github.com/go-scikit/go-scikit.github.io/example

go 1.27.2

require (
github.com/go-ndarray/ndarray v0.12.0
github.com/go-statistics/stats v0.1.0
)

require (
github.com/go-notebook/notebook v0.2.0 // indirect
github.com/go-numerics/optimize v0.1.0 // indirect
github.com/go-numerics/special v0.1.0 // indirect
github.com/go-opentype/opentype v0.13.0 // indirect
github.com/go-regexp/engine v0.1.3 // indirect
github.com/go-rouge/rouge v0.4.0 // indirect
github.com/go-ruby-regexp/regexp v0.0.0-20260927145504-6cbb63926eb2 // indirect
github.com/go-tex/math v0.50.0 // indirect
github.com/yuin/goldmark v1.8.6 // indirect
golang.org/x/mod v0.41.0 // indirect
golang.org/x/sync v0.23.0 // indirect
golang.org/x/sys v0.49.0 // indirect
golang.org/x/tools v0.51.0 // indirect
)

tool github.com/go-notebook/notebook/cmd/notebook
32 changes: 32 additions & 0 deletions example/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
github.com/go-ndarray/ndarray v0.12.0 h1:4xfl9ZQo1m0UXopo06KypELg1wUYgQb5kdKaJPZAZus=
github.com/go-ndarray/ndarray v0.12.0/go.mod h1:ZcgNCBVLXt1FxeZjQWI5Z+k0SSWAT0/wR8slfat/gRA=
github.com/go-notebook/notebook v0.2.0 h1:W3z9TbBCyqsHaRcEpa2csMw5UDe8JsgOu6Hwd/R1T6M=
github.com/go-notebook/notebook v0.2.0/go.mod h1:cqXgByviyVH6wBixaCPPnHfJkPP1c3jh2JAAfaz2Zf8=
github.com/go-numerics/optimize v0.1.0 h1:SOA+QxTuIjeZSAsd5Dyj433lItnOKWyprCbHQoLxg/c=
github.com/go-numerics/optimize v0.1.0/go.mod h1:ieZ+/EsbBw/EfHl4W8JryPyCBB8n5a8xKk6lu/xh7zk=
github.com/go-numerics/special v0.1.0 h1:HcsebTwcNuAhFBP8RuOirO9XVmWJSrxARiOVkyeCfUk=
github.com/go-numerics/special v0.1.0/go.mod h1:T0QKLvh32lH5Bq9wiTEvtlaFd1vaOKRGrOPgvTeYfdM=
github.com/go-opentype/opentype v0.13.0 h1:q9K7IGDfwMP/ik51ZkwiYf6jbaqPfocvAIuojetd0UQ=
github.com/go-opentype/opentype v0.13.0/go.mod h1:AOixevJf7XQaH7+WG+OMIOZEbYPXfMqklVk26Y6YTUU=
github.com/go-regexp/engine v0.1.3 h1:0U5DrrBEYjNX/f0yFESpQDWmJOtXmmZqluNAUBXjfxY=
github.com/go-regexp/engine v0.1.3/go.mod h1:8rju5lq5OkskQh9+m+FjBP6965giMPUdIOdrvFrbqn4=
github.com/go-rouge/rouge v0.4.0 h1:f/5EVTEwiEnBOeyAtkV8r5KopdIRAsRoA7Kzi/cyh2Y=
github.com/go-rouge/rouge v0.4.0/go.mod h1:V4Xlyl1EDqEfrzloW9y6X0xpv/WvCvTiOWNIcByw2Y8=
github.com/go-ruby-regexp/regexp v0.0.0-20260927145504-6cbb63926eb2 h1:pNvJf0zgzg0rTEq1fToFa5fnzK13nIble80caTmdG3g=
github.com/go-ruby-regexp/regexp v0.0.0-20260927145504-6cbb63926eb2/go.mod h1:I3i2r1AXulgMBt/KiWBcxjnoNsB09ZFKkj2Vb5Mhzuw=
github.com/go-statistics/stats v0.1.0 h1:m8/5lxOZEcbWp51T6evG3Yx0ZzMlOO2wIEZa8uBGryA=
github.com/go-statistics/stats v0.1.0/go.mod h1:hyKv4yhaJ7aDpNbR1MLNjiiBPeP5iZb8Q075y+q+FEw=
github.com/go-tex/math v0.50.0 h1:YHJ3LYzS45zBoPKGBkZW4+LUQkOeHP30YWLsfXGZCpo=
github.com/go-tex/math v0.50.0/go.mod h1:cPm5juijQkhFj1MCByLF8tOfZ+UswAGUPBh+Wy6+vbw=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/yuin/goldmark v1.8.6 h1:d0VcaP1sx9GkFVkoW+KtggpGi2KZ965i14b0+bDQST4=
github.com/yuin/goldmark v1.8.6/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c=
golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o=
golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk=
golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA=
golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og=
golang.org/x/tools v0.51.0 h1:k4Xc/1Om9jwkBJBo4NVLMSARBoWtK10mx+W5BnXCeAI=
golang.org/x/tools v0.51.0/go.mod h1:9eEncMayCV6zRMGhR5eZEC2iBx98qWcF1HZ9Z7wJOoA=
4 changes: 4 additions & 0 deletions example/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
── cell 0 (line 4)
── cell 1 (line 14)
── cell 2 (line 19)
[8.607374170843807 10.012355742798341 11.179773490450081]
5 changes: 5 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/go-scikit/go-scikit.github.io

go 1.27.2

require github.com/go-fleettools/landingkit v0.3.1
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/go-fleettools/landingkit v0.3.1 h1:vW/xVaXYKF+XXgFFQAqBKhSWV6hpCkvsAZ3t1MdWPnc=
github.com/go-fleettools/landingkit v0.3.1/go.mod h1:NUBMh7cVFUfD/hX6Xv5ef2O/r4F6rPtPGGVd3T+9qc0=
Loading
Loading