mirror of
https://github.com/julia-actions/julia-buildpkg.git
synced 2026-02-12 09:26:54 +08:00
Compare commits
17 Commits
v1.4.4
...
cv/add-reg
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad723e2fe5 | ||
|
|
33033861f0 | ||
|
|
a208c66935 | ||
|
|
3c1df8e430 | ||
|
|
93acad015a | ||
|
|
951839e464 | ||
|
|
bfc4263fef | ||
|
|
320bd0725f | ||
|
|
ab02b8f55c | ||
|
|
90dd6f23eb | ||
|
|
d4b940ea5e | ||
|
|
7c82bcb737 | ||
|
|
015ebdb7f3 | ||
|
|
b949419b86 | ||
|
|
c00cff0b17 | ||
|
|
3d96aa283a | ||
|
|
5484b0e27f |
12
.github/dependabot.yml
vendored
Normal file
12
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
# Keep dependencies for GitHub Actions up-to-date
|
||||||
|
- package-ecosystem: 'github-actions'
|
||||||
|
directory: '/'
|
||||||
|
schedule:
|
||||||
|
interval: 'daily'
|
||||||
4
.github/workflows/backup.yml
vendored
4
.github/workflows/backup.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Configure cache
|
- name: Configure cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
${{ env.GITHUB_WORKSPACE }}
|
${{ env.GITHUB_WORKSPACE }}
|
||||||
@@ -20,7 +20,7 @@ jobs:
|
|||||||
key: ${{ runner.os }}
|
key: ${{ runner.os }}
|
||||||
|
|
||||||
- name: Install the correct Python version
|
- name: Install the correct Python version
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
|
|||||||
41
.github/workflows/ci.yml
vendored
41
.github/workflows/ci.yml
vendored
@@ -4,7 +4,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
- "master"
|
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "README.md"
|
- "README.md"
|
||||||
- "LICENSE"
|
- "LICENSE"
|
||||||
@@ -17,10 +16,11 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: ${{ github.event_name == 'pull_request' }}
|
||||||
matrix:
|
matrix:
|
||||||
version:
|
version:
|
||||||
- "1.0"
|
- "1.0"
|
||||||
|
- "1.6" # Long-term support (LTS) release of Julia
|
||||||
- "1" # automatically expands to the latest stable 1.x release of Julia
|
- "1" # automatically expands to the latest stable 1.x release of Julia
|
||||||
- nightly
|
- nightly
|
||||||
os:
|
os:
|
||||||
@@ -33,14 +33,19 @@ jobs:
|
|||||||
pkg-server:
|
pkg-server:
|
||||||
- ""
|
- ""
|
||||||
- "pkg.julialang.org"
|
- "pkg.julialang.org"
|
||||||
# 32-bit Julia binaries are not available on macOS
|
|
||||||
exclude:
|
exclude:
|
||||||
|
# 32-bit Julia binaries are not available on macOS
|
||||||
- os: macOS-latest
|
- os: macOS-latest
|
||||||
arch: x86
|
arch: x86
|
||||||
|
# Only Julia 1.7+ can use the package server
|
||||||
|
- version: "1.0"
|
||||||
|
pkg-server: "pkg.julialang.org"
|
||||||
|
- version: "1.6"
|
||||||
|
pkg-server: "pkg.julialang.org"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Example.jl
|
- name: Checkout Example.jl
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: julia-actions/Example.jl
|
repository: julia-actions/Example.jl
|
||||||
|
|
||||||
@@ -49,7 +54,7 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Checkout julia-buildpkg
|
- name: Checkout julia-buildpkg
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: ./.github/actions/julia-buildpkg
|
path: ./.github/actions/julia-buildpkg
|
||||||
|
|
||||||
@@ -58,26 +63,28 @@ jobs:
|
|||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ matrix.arch }}
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
|
||||||
env:
|
|
||||||
cache-name: cache-artifacts
|
|
||||||
with:
|
|
||||||
path: ~/.julia/artifacts
|
|
||||||
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-test-${{ env.cache-name }}-
|
|
||||||
${{ runner.os }}-test-
|
|
||||||
${{ runner.os }}-
|
|
||||||
|
|
||||||
- uses: ./.github/actions/julia-buildpkg
|
- uses: ./.github/actions/julia-buildpkg
|
||||||
|
with:
|
||||||
|
ignore-no-cache: true
|
||||||
|
localregistry: |
|
||||||
|
https://github.com/JuliaRegistries/General.git
|
||||||
env:
|
env:
|
||||||
JULIA_PKG_SERVER: ${{ matrix.pkg-server }}
|
JULIA_PKG_SERVER: ${{ matrix.pkg-server }}
|
||||||
|
|
||||||
|
# When using the Pkg server the `Pkg.Registry.add("General")` will add the General registry
|
||||||
|
# via Pkg servers. Using `localregistry` to clone the General registry via HTTPS should be
|
||||||
|
# skipped.
|
||||||
|
- name: Test skipping registry cloning of duplicate repos
|
||||||
|
if: ${{ matrix.pkg-server == 'pkg.julialang.org' }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
! test -d $HOME/.julia/registries/General
|
||||||
|
|
||||||
- uses: julia-actions/julia-runtest@v1
|
- uses: julia-actions/julia-runtest@v1
|
||||||
|
|
||||||
- uses: julia-actions/julia-processcoverage@v1
|
- uses: julia-actions/julia-processcoverage@v1
|
||||||
|
|
||||||
- uses: codecov/codecov-action@v1
|
- uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
file: lcov.info
|
file: lcov.info
|
||||||
|
|
||||||
|
|||||||
26
README.md
26
README.md
@@ -43,3 +43,29 @@ is already set. If you want another registry flavor (i.e. `conservative`) this
|
|||||||
should be defined in the `env:` section of the relevant workflow or step. See
|
should be defined in the `env:` section of the relevant workflow or step. See
|
||||||
[Registry flavors](https://pkgdocs.julialang.org/dev/registries/#Registry-flavors)
|
[Registry flavors](https://pkgdocs.julialang.org/dev/registries/#Registry-flavors)
|
||||||
for more information.
|
for more information.
|
||||||
|
|
||||||
|
### Adding Local Registries
|
||||||
|
|
||||||
|
Personal registries, e.g. created with [LocalRegistry.jl](https://github.com/GunnarFarneback/LocalRegistry.jl), can be added to the CI using the `localregistry` input option. If the personal registry as well as packages needed in the current project are public, no additional setup is required if the registry url is specified in https-format.
|
||||||
|
|
||||||
|
If the registry contains private packages, or is itself private, the ssh protocol should to be used. The user has to provide the corresponding private SSH-keys to the `ssh-agent` to access packages and registry. This can be conveniently done using the [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) action. A snippet illustrating the usage of (private) personal registries is shown below
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
...
|
||||||
|
# Adding private SSH keys (only necessary for accessing private packages and/or
|
||||||
|
# when providing Registry-link in ssh format)
|
||||||
|
- uses: webfactory/ssh-agent@v0.8.0
|
||||||
|
with:
|
||||||
|
ssh-private-key: |
|
||||||
|
${{ secrets.PRIVATE_DEPLOY_KEY }}
|
||||||
|
${{ secrets.PRIVATE_DEPLOY_KEY2 }}
|
||||||
|
- uses: julia-actions/julia-buildpkg@v1
|
||||||
|
with:
|
||||||
|
localregistry: |
|
||||||
|
https://github.com/username/PersonalRegistry.git
|
||||||
|
git@github.com:username2/PersonalRegistry2.git
|
||||||
|
git_cli: false # = JULIA_PKG_USE_CLI_GIT. Options: true | false (default)
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
For Julia 1.7 and above, the `git_cli` option can be used to set the `JULIA_PKG_USE_CLI_GIT` [environment flag](https://docs.julialang.org/en/v1/manual/environment-variables/), for additional control of the SSH configuration used by `Pkg` to add/dev packages.
|
||||||
50
action.yml
50
action.yml
@@ -13,6 +13,17 @@ inputs:
|
|||||||
precompile:
|
precompile:
|
||||||
description: 'Whether to allow auto-precompilation (via the `JULIA_PKG_PRECOMPILE_AUTO` env var). Options: yes | no. Default value: no.'
|
description: 'Whether to allow auto-precompilation (via the `JULIA_PKG_PRECOMPILE_AUTO` env var). Options: yes | no. Default value: no.'
|
||||||
default: 'no'
|
default: 'no'
|
||||||
|
localregistry:
|
||||||
|
description: 'Add local registries hosted on GitHub. Specified by providing the url (https/ssh) to the repositories as a newline (\n) seperated list.
|
||||||
|
User is responsible for setting up the necessary SSH-Keys to access the repositories if necessary.'
|
||||||
|
default: ''
|
||||||
|
git_cli:
|
||||||
|
description: 'Determine if Pkg uses the cli git executable (Julia >= 1.7). Might be necessary for more complicated SSH setups.
|
||||||
|
Options: true | false. Default : false'
|
||||||
|
default: 'false'
|
||||||
|
ignore-no-cache:
|
||||||
|
description: 'Whether to ignore if there appears to be no depot caching. Silences an action notice recommending `julia-actions/cache`.'
|
||||||
|
default: 'false'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
@@ -21,9 +32,46 @@ runs:
|
|||||||
run: echo "JULIA_PKG_SERVER_REGISTRY_PREFERENCE=${JULIA_PKG_SERVER_REGISTRY_PREFERENCE:-eager}" >> ${GITHUB_ENV}
|
run: echo "JULIA_PKG_SERVER_REGISTRY_PREFERENCE=${JULIA_PKG_SERVER_REGISTRY_PREFERENCE:-eager}" >> ${GITHUB_ENV}
|
||||||
shell: bash
|
shell: bash
|
||||||
- run: |
|
- run: |
|
||||||
|
if "${{ inputs.ignore-no-cache }}" == "false" && !isdir(DEPOT_PATH[1])
|
||||||
|
println("::notice title=[julia-buildpkg] Caching of the julia depot was not detected ::Consider using `julia-actions/cache` to speed up runs https://github.com/julia-actions/cache. To ignore, set input `ignore-no-cache: true` ")
|
||||||
|
end
|
||||||
import Pkg
|
import Pkg
|
||||||
VERSION >= v"1.5-" && Pkg.Registry.add("General")
|
|
||||||
|
# Determine if Pkg uses git-cli executable instead of LibGit2
|
||||||
|
VERSION >= v"1.7-" && (ENV["JULIA_PKG_USE_CLI_GIT"] = ${{ inputs.git_cli }})
|
||||||
|
|
||||||
|
if VERSION < v"1.7-" && ${{ inputs.git_cli }} == true
|
||||||
|
printstyled("::notice::JULIA_PKG_USE_CLI_GIT requires Julia >= 1.7. Using default LibGit2 git-interface instead! \n"; color = :yellow)
|
||||||
|
end
|
||||||
|
|
||||||
|
if VERSION >= v"1.5-"
|
||||||
|
function reachable_registries()
|
||||||
|
return if VERSION >= v"1.7-"
|
||||||
|
Pkg.Registry.reachable_registries()
|
||||||
|
else
|
||||||
|
[(; name=r.name, repo=r.url) for r in Pkg.Types.collect_registries()]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if !any(r -> r.name == "General", reachable_registries())
|
||||||
|
Pkg.Registry.add("General")
|
||||||
|
end
|
||||||
|
|
||||||
|
# If provided add local registries
|
||||||
|
if !isempty(ENV["LOCAL_REGISTRY"])
|
||||||
|
local_repos = split(ENV["LOCAL_REGISTRY"], "\n"; keepempty=false) .|> string
|
||||||
|
for repo_url in local_repos
|
||||||
|
# https://github.com/JuliaLang/Pkg.jl/issues/3753
|
||||||
|
if !any(r -> r.repo == repo_url, reachable_registries())
|
||||||
|
Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
VERSION >= v"1.1.0-rc1" ? retry(Pkg.build)(verbose=true) : retry(Pkg.build)()
|
VERSION >= v"1.1.0-rc1" ? retry(Pkg.build)(verbose=true) : retry(Pkg.build)()
|
||||||
shell: julia --color=yes --project=${{ inputs.project }} {0}
|
shell: julia --color=yes --project=${{ inputs.project }} {0}
|
||||||
env:
|
env:
|
||||||
JULIA_PKG_PRECOMPILE_AUTO: "${{ inputs.precompile }}"
|
JULIA_PKG_PRECOMPILE_AUTO: "${{ inputs.precompile }}"
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
LOCAL_REGISTRY: ${{ inputs.localregistry }}
|
||||||
|
|||||||
Reference in New Issue
Block a user