diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index afaf0bb..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,10 +0,0 @@ -version: 2 -updates: - - package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - - package-ecosystem: pip - directory: "/" - schedule: - interval: daily diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..0edac10 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:best-practices" + ], + "packageRules": [ + { + "matchUpdateTypes": ["minor", "patch", "pin", "digest"], + "automerge": true + } + ], + "lockFileMaintenance": { + "enabled": true, + "automerge": true + }, + "git-submodules": { + "enabled": true + }, + "platformAutomerge": true, + "automergeStrategy": "squash" +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d15c07a..73b7289 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,54 +25,59 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 id: setup-python with: python-version: '3.x' - - name: Cache python - uses: actions/cache@v4 + - name: Cache python venv + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 if: ${{ contains(runner.name, 'GitHub Actions') }} - id: cache-py + id: cache-venv with: - key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt') }} - path: | - ${{ env.pythonLocation }}/lib - ${{ env.pythonLocation }}/bin + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt') }} + path: .venv - name: Install Python dependencies - if: ${{ !contains(runner.name, 'GitHub Actions') || steps.cache-py.outputs.cache-hit != 'true' }} - run: pip install -r requirements.txt + run: | + python -m venv .venv + source .venv/bin/activate + python -m pip install -r requirements.txt + echo "${VIRTUAL_ENV}/bin" >> $GITHUB_PATH + echo "VIRTUAL_ENV=${VIRTUAL_ENV}" >> $GITHUB_ENV + echo "PYTHON=${VIRTUAL_ENV}/bin/python" >> $GITHUB_ENV + echo "JULIA_PYTHONCALL_EXE=${VIRTUAL_ENV}/bin/python">> $GITHUB_ENV - name: Cache executed notebooks - uses: actions/cache@v4 + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 id: cache-nb with: path: ${{ env.NBCACHE }} - key: ${{ runner.os }}-nb-${{ env.CACHE_NUM }}-${{ hashFiles('src/**', 'Project.toml', 'Manifest.toml') }}-${{ hashFiles('docs/**/*.ipynb', 'docs/**/*.jl') }} + key: ${{ runner.os }}-nb-${{ env.CACHE_NUM }}-${{ hashFiles('src/**', 'Project.toml', 'Manifest.toml', 'requirements.txt') }}-${{ hashFiles('docs/**/*.ipynb', 'docs/**/*.jl') }} restore-keys: | - ${{ runner.os }}-nb-${{ env.CACHE_NUM }}-${{ hashFiles('src/**', 'Project.toml', 'Manifest.toml') }}- + ${{ runner.os }}-nb-${{ env.CACHE_NUM }}-${{ hashFiles('src/**', 'Project.toml', 'Manifest.toml', 'requirements.txt') }}- - name: Read Julia version + uses: SebRollen/toml-action@b1b3628f55fc3a28208d4203ada8b737e9687876 # v1.2.0 id: read_toml - run: echo "value=$(python -c 'import tomllib; from pathlib import Path; print(tomllib.loads(Path("Manifest.toml").read_text())["julia_version"])')" >> "$GITHUB_OUTPUT" + with: + file: 'Manifest.toml' + field: 'julia_version' - name: Setup Julia - uses: julia-actions/setup-julia@v2 + uses: julia-actions/setup-julia@f2258781c657ad9b4b88072c5eeaf9ec8c370874 # v2 with: version: ${{ steps.read_toml.outputs.value }} - name: Restore Julia packages - uses: actions/cache/restore@v4 + uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 if: ${{ contains(runner.name, 'GitHub Actions') }} id: cache-julia with: path: | ~/.julia !~/.julia/registries - key: ${{ runner.os }}-julia-${{ env.CACHE_NUM }}-${{ hashFiles('src/**', 'Project.toml', 'Manifest.toml') }} + key: ${{ runner.os }}-julia-${{ env.CACHE_NUM }}-${{ steps.read_toml.outputs.value }}-${{ hashFiles('src/**', 'Project.toml', 'Manifest.toml') }} restore-keys: | - ${{ runner.os }}-julia-${{ env.CACHE_NUM }}- + ${{ runner.os }}-julia-${{ env.CACHE_NUM }}-${{ steps.read_toml.outputs.value }}- - name: Install Julia packages if: ${{ !contains(runner.name, 'GitHub Actions') || steps.cache-julia.outputs.cache-hit != 'true' }} - env: - PYTHON: ${{ steps.setup-python.outputs.python-path }} shell: julia --color=yes {0} run: | using Pkg, Dates @@ -82,7 +87,7 @@ jobs: Pkg.precompile() Pkg.gc(collect_delay=Day(0)) - name: Save Julia packages - uses: actions/cache/save@v4 + uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 if: ${{ contains(runner.name, 'GitHub Actions') && steps.cache-julia.outputs.cache-hit != 'true' }} with: path: | @@ -97,7 +102,7 @@ jobs: run: jupyter-book build docs/ - name: Upload pages artifact if: ${{ github.ref == 'refs/heads/main' }} - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 with: path: docs/_build/html/ @@ -117,4 +122,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 38ea4de..1ddc194 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -4,12 +4,12 @@ on: workflow_dispatch: schedule: - cron: '0 0 1 * *' # Every month - # push: - # branches: - # - main - # paths: - # - 'docs/**' - # - '.github/workflows/linkcheck.yml' + push: + branches: + - main + paths: + - 'docs/**' + - '.github/workflows/linkcheck.yml' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -22,9 +22,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 - name: Setup Julia - uses: julia-actions/setup-julia@v2 + uses: julia-actions/setup-julia@f2258781c657ad9b4b88072c5eeaf9ec8c370874 # v2 - name: Convert literate notebooks to ipynb files shell: julia --color=yes {0} working-directory: ${{ env.DIR }} @@ -41,21 +41,23 @@ jobs: end end - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 id: setup-python with: python-version: '3.x' - - name: Cache python - uses: actions/cache@v4 + - name: Cache python venv + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 if: ${{ contains(runner.name, 'GitHub Actions') }} - id: cache-py + id: cache-venv with: - key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt') }} - path: | - ${{ env.pythonLocation }}/lib - ${{ env.pythonLocation }}/bin + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('requirements.txt') }} + path: .venv - name: Install Python dependencies - if: ${{ !contains(runner.name, 'GitHub Actions') || steps.cache-py.outputs.cache-hit != 'true' }} - run: pip install -r requirements.txt + run: | + python -m venv .venv + source .venv/bin/activate + python -m pip install -r requirements.txt + echo "${VIRTUAL_ENV}/bin" >> $GITHUB_PATH + echo "VIRTUAL_ENV=${VIRTUAL_ENV}" >> $GITHUB_ENV - name: Build website run: jupyter-book build ${DIR} --builder linkcheck diff --git a/.github/workflows/update-manifest.yml b/.github/workflows/update-manifest.yml index bd20659..36c5613 100644 --- a/.github/workflows/update-manifest.yml +++ b/.github/workflows/update-manifest.yml @@ -25,9 +25,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 - name: Setup Julia - uses: julia-actions/setup-julia@v2 + uses: julia-actions/setup-julia@f2258781c657ad9b4b88072c5eeaf9ec8c370874 # v2 with: version: '1' - name: Update Julia dependencies @@ -37,14 +37,14 @@ jobs: # Authenticate with a custom GitHub APP # https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#authenticating-with-github-app-generated-tokens - name: Generate token for PR - uses: tibdex/github-app-token@v2 + uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2 id: generate-token with: app_id: ${{ env.APP_ID }} private_key: ${{ secrets.APP_PRIVATE_KEY }} - name: Create Pull Request id: cpr - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6 with: title: Julia Dependency Update token: ${{ steps.generate-token.outputs.token }}