Skip to content

How to handle a GH action that raises LoadError on a package? #2770

@dankelley

Description

@dankelley

I am trying to document my first julia package
(https://github.com/dankelley/OceanAnalysis.jl) and am using the github method
for deployment.

Unfortunately, my github "action" raises a LoadError error about a package that
is not installed (see Resource 1 below). I tried something to help with that
in my workflow (Resource 2 below) but that is evidently not correct. To be
honest, I've been guessing at things and pushing trials for a while now, and am
going in circles.

I wonder if someone can suggest a way for me to tackle this problem. A pointer to a URL
that works (that doesn't rest on extra shellscripts, etc. as some seem to) would be greatly appreciated.

Thanks in advance. Dan Kelley / Department of Oceanography / Dalhousie University / Canada

Resource 1: the error in the github action

Precompiling Pkg...

           ✗ LibSSH2_jll

           ✗ LibGit2_jll

           ✗ LibGit2

Info Given Pkg was explicitly requested, output will be shown live 

ERROR: LoadError: ArgumentError: Package MbedTLS_jll [c8ffd9c3-330d-5841-b78e-0817d7145fa1] is required but does not seem to be installed:

 - Run `Pkg.instantiate()` to install all recorded dependencies.

Resource 2: my github/workflow/documenter.yaml file

name: Documentation

on:
  push:
    branches:
      - main # update to match your development branch (master, main, dev, trunk, ...)
    tags: '*'
  pull_request:

jobs:
  build:
    # These permissions are needed to:
    # - Deploy the documentation: https://documenter.juliadocs.org/stable/man/hosting/#Permissions
    # - Delete old caches: https://github.com/julia-actions/cache#usage
    permissions:
      actions: write
      contents: write
      pull-requests: read
      statuses: write
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: julia-actions/setup-julia@v2
        with:
          version: '1'
      - uses: julia-actions/cache@v2
      - name: Install dependencies
        shell: julia --color=yes --project=docs {0}
        run: |
          using Pkg
          Pkg.add(PackageSpec(name="MbedTLS_jll"))
          Pkg.add(PackageSpec(name="LibGit2_jll"))
          Pkg.develop(PackageSpec(path=pwd()))
          Pkg.instantiate()
      - name: Build and deploy
        run: julia --color=yes --project=docs docs/make.jl
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
          DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions