|  | 
|  | 1 | +name: "Reusable CompatHelper Workflow" | 
|  | 2 | + | 
|  | 3 | +on: | 
|  | 4 | +  workflow_call: | 
|  | 5 | +    inputs: | 
|  | 6 | +      julia-version: | 
|  | 7 | +        description: "Julia version" | 
|  | 8 | +        default: "1" | 
|  | 9 | +        required: false | 
|  | 10 | +        type: string | 
|  | 11 | + | 
|  | 12 | +jobs: | 
|  | 13 | +  CompatHelper: | 
|  | 14 | +    runs-on: ubuntu-latest | 
|  | 15 | +    steps: | 
|  | 16 | +      - name: Check if Julia is already available in the PATH | 
|  | 17 | +        id: julia_in_path | 
|  | 18 | +        run: which julia | 
|  | 19 | +        continue-on-error: true | 
|  | 20 | +      - name: Install Julia, but only if it is not already available in the PATH | 
|  | 21 | +        uses: julia-actions/setup-julia@v2 | 
|  | 22 | +        with: | 
|  | 23 | +          version: "${{ inputs.julia-version }}" | 
|  | 24 | +          arch: ${{ runner.arch }} | 
|  | 25 | +        if: steps.julia_in_path.outcome != 'success' | 
|  | 26 | +      - name: "Add the General registry via Git" | 
|  | 27 | +        run: | | 
|  | 28 | +          import Pkg | 
|  | 29 | +          ENV["JULIA_PKG_SERVER"] = "" | 
|  | 30 | +          Pkg.Registry.add("General") | 
|  | 31 | +        shell: julia --color=yes {0} | 
|  | 32 | +      - name: "Install CompatHelper" | 
|  | 33 | +        run: | | 
|  | 34 | +          import Pkg | 
|  | 35 | +          name = "CompatHelper" | 
|  | 36 | +          uuid = "aa819f21-2bde-4658-8897-bab36330d9b7" | 
|  | 37 | +          version = "3" | 
|  | 38 | +          Pkg.add(; name, uuid, version) | 
|  | 39 | +        shell: julia --color=yes {0} | 
|  | 40 | +      - name: "Run CompatHelper" | 
|  | 41 | +        run: | | 
|  | 42 | +          import CompatHelper | 
|  | 43 | +          import Pkg | 
|  | 44 | +          registries = [ | 
|  | 45 | +              Pkg.RegistrySpec( | 
|  | 46 | +                  name = "General", | 
|  | 47 | +                  uuid = "23338594-aafe-5451-b93e-139f81909106", | 
|  | 48 | +                  url = "https://github.com/JuliaRegistries/General.git", | 
|  | 49 | +              ), | 
|  | 50 | +              Pkg.RegistrySpec( | 
|  | 51 | +                  name = "ITensorRegistry", | 
|  | 52 | +                  uuid = "c4d53e37-7e0e-4be9-ba6f-c27e01f48020", | 
|  | 53 | +                  url = "https://github.com/ITensor/ITensorRegistry.git", | 
|  | 54 | +              ), | 
|  | 55 | +          ] | 
|  | 56 | +          CompatHelper.main(; registries) | 
|  | 57 | +        shell: julia --color=yes {0} | 
|  | 58 | +        env: | 
|  | 59 | +          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | 
|  | 60 | +          # This repo uses Documenter, so we can reuse our [Documenter SSH key](https://documenter.juliadocs.org/stable/man/hosting/walkthrough/). | 
|  | 61 | +          # If we didn't have one of those setup, we could configure a dedicated ssh deploy key `COMPATHELPER_PRIV` following https://juliaregistries.github.io/CompatHelper.jl/dev/#Creating-SSH-Key. | 
|  | 62 | +          # Either way, we need an SSH key if we want the PRs that CompatHelper creates to be able to trigger CI workflows themselves. | 
|  | 63 | +          # That is because GITHUB_TOKEN's can't trigger other workflows (see https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow). | 
|  | 64 | +          # Check if you have a deploy key setup using these docs: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/reviewing-your-deploy-keys. | 
|  | 65 | +          COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} | 
|  | 66 | +          # COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} | 
0 commit comments