Skip to content
Open
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
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
# Keep GitHub Actions up to date
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
github-actions:
patterns:
- "*"

# Keep Julia dependencies up to date
- package-ecosystem: "julia"
directory: "/"
schedule:
interval: "weekly"
groups:
julia-deps:
patterns:
- "*"
37 changes: 37 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI
on:
push:
branches:
- main
- master
tags: ['*']
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
name: Julia ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions:
actions: write
contents: read
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macOS-latest
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
24 changes: 0 additions & 24 deletions .github/workflows/CompatHelper.yml

This file was deleted.

154 changes: 154 additions & 0 deletions .github/workflows/Docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Docs

on:
push:
branches:
- main
tags:
- 'v*'
workflow_dispatch:

permissions:
contents: write

concurrency:
group: pages
cancel-in-progress: false

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

# Determine deploy target from ref
- name: Set deploy version
id: version
run: |
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF#refs/tags/}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "is_release=true" >> "$GITHUB_OUTPUT"
else
echo "version=dev" >> "$GITHUB_OUTPUT"
echo "is_release=false" >> "$GITHUB_OUTPUT"
fi

# Build docs
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- uses: julia-actions/cache@v2
- name: Install docs dependencies
run: julia --project=docs -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()'
- name: Install lcov
run: sudo apt-get install -y lcov
- uses: quarto-dev/quarto-actions/setup@v2
- name: Set build date
run: sed -i "s/__BUILD_DATE__/$(date -u +'%Y-%m-%d')/" docs/_quarto.yml
- uses: quarto-dev/quarto-actions/render@v2
with:
path: docs

# Deploy to gh-pages branch
- name: Deploy to gh-pages
env:
VERSION: ${{ steps.version.outputs.version }}
IS_RELEASE: ${{ steps.version.outputs.is_release }}
REPO_NAME: ${{ github.event.repository.name }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

# Clone gh-pages branch or create orphan
if git ls-remote --exit-code origin gh-pages; then
git clone --branch gh-pages --single-branch "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" gh-pages-deploy
else
mkdir gh-pages-deploy
cd gh-pages-deploy
git init
git checkout --orphan gh-pages
git commit --allow-empty -m "Initialize gh-pages"
cd ..
fi

# Copy built docs to version directory
rm -rf "gh-pages-deploy/${VERSION}"
cp -r docs/_site "gh-pages-deploy/${VERSION}"

cd gh-pages-deploy

# If release tag: update versions.json and stable redirect
if [ "$IS_RELEASE" = "true" ]; then
# Update versions.json
if [ -f versions.json ]; then
# Add new version and sort by semver descending
python3 -c "
import json, re
with open('versions.json') as f:
versions = json.load(f)
ver = '${VERSION}'
if ver not in versions:
versions.append(ver)
def semver_key(v):
nums = re.findall(r'\d+', v)
return tuple(int(n) for n in nums)
versions.sort(key=semver_key, reverse=True)
with open('versions.json', 'w') as f:
json.dump(versions, f, indent=2)
"
else
echo "[\"${VERSION}\"]" > versions.json
fi

# Update stable redirect
mkdir -p stable
cat > stable/index.html << STABLE_EOF
<!DOCTYPE html>
<html>
<head><meta http-equiv="refresh" content="0; url=/${REPO_NAME}/${VERSION}/"></head>
<body>Redirecting to <a href="/${REPO_NAME}/${VERSION}/">latest stable</a>...</body>
</html>
STABLE_EOF
fi

# Create stable placeholder if no releases yet
if [ ! -d stable ]; then
mkdir -p stable
cat > stable/index.html << PLACEHOLDER_EOF
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>No Stable Release Yet</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="d-flex align-items-center justify-content-center min-vh-100 bg-light">
<div class="text-center p-5">
<h1 class="mb-3">No Stable Release Yet</h1>
<p class="lead text-muted">This package has not published a release.<br>Check out the <a href="/${REPO_NAME}/dev/">development docs</a> instead.</p>
</div>
</body>
</html>
PLACEHOLDER_EOF
fi

# Always update root redirect to stable
cat > index.html << ROOT_EOF
<!DOCTYPE html>
<html>
<head><meta http-equiv="refresh" content="0; url=/${REPO_NAME}/stable/"></head>
<body>Redirecting to <a href="/${REPO_NAME}/stable/">stable docs</a>...</body>
</html>
ROOT_EOF

touch .nojekyll

git add -A
if git diff --cached --quiet; then
echo "No changes to deploy"
else
git commit -m "Deploy docs: ${VERSION}"
git push "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git" HEAD:gh-pages
fi
Loading
Loading