diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0134ffc --- /dev/null +++ b/.github/dependabot.yml @@ -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: + - "*" diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..8c5e990 --- /dev/null +++ b/.github/workflows/CI.yml @@ -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 diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml deleted file mode 100644 index 6992ce6..0000000 --- a/.github/workflows/CompatHelper.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: CompatHelper - -on: - schedule: - - cron: '00 00 * * *' - -jobs: - CompatHelper: - runs-on: ${{ matrix.os }} - strategy: - matrix: - julia-version: [1.2.0] - julia-arch: [x86] - os: [ubuntu-latest] - steps: - - uses: julia-actions/setup-julia@latest - with: - version: ${{ matrix.julia-version }} - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: julia -e 'using CompatHelper; CompatHelper.main()' diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml new file mode 100644 index 0000000..326d452 --- /dev/null +++ b/.github/workflows/Docs.yml @@ -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 + + +
+ Redirecting to latest stable... + + STABLE_EOF + fi + + # Create stable placeholder if no releases yet + if [ ! -d stable ]; then + mkdir -p stable + cat > stable/index.html << PLACEHOLDER_EOF + + + + + +This package has not published a release.
Check out the development docs instead.