mirror of
https://github.com/julia-actions/julia-buildpkg.git
synced 2026-02-15 10:46:54 +08:00
Compare commits
9 Commits
dependabot
...
cv/add-reg
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad723e2fe5 | ||
|
|
33033861f0 | ||
|
|
a208c66935 | ||
|
|
3c1df8e430 | ||
|
|
93acad015a | ||
|
|
951839e464 | ||
|
|
bfc4263fef | ||
|
|
320bd0725f | ||
|
|
ab02b8f55c |
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@v4
|
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@v6
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
|
|
||||||
|
|||||||
32
.github/workflows/ci.yml
vendored
32
.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@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
repository: julia-actions/Example.jl
|
repository: julia-actions/Example.jl
|
||||||
|
|
||||||
@@ -49,11 +54,11 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Checkout julia-buildpkg
|
- name: Checkout julia-buildpkg
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
path: ./.github/actions/julia-buildpkg
|
path: ./.github/actions/julia-buildpkg
|
||||||
|
|
||||||
- uses: julia-actions/setup-julia@v2
|
- uses: julia-actions/setup-julia@v1
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.version }}
|
version: ${{ matrix.version }}
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ matrix.arch }}
|
||||||
@@ -61,16 +66,27 @@ jobs:
|
|||||||
- uses: ./.github/actions/julia-buildpkg
|
- uses: ./.github/actions/julia-buildpkg
|
||||||
with:
|
with:
|
||||||
ignore-no-cache: true
|
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@v5
|
- uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
files: lcov.info
|
file: lcov.info
|
||||||
|
|
||||||
- name: Verify that test output file exists
|
- name: Verify that test output file exists
|
||||||
run: test -f "$HOME/julia-buildpkg"
|
run: test -f "$HOME/julia-buildpkg"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Julia needs to be installed before this action can run. This can easily be achie
|
|||||||
|
|
||||||
And example workflow that uses this action might look like this:
|
And example workflow that uses this action might look like this:
|
||||||
|
|
||||||
```yaml
|
```
|
||||||
name: Run tests
|
name: Run tests
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
@@ -26,8 +26,8 @@ jobs:
|
|||||||
julia-arch: x86
|
julia-arch: x86
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v2
|
||||||
- uses: julia-actions/setup-julia@v2
|
- uses: julia-actions/setup-julia@v1
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.julia-version }}
|
version: ${{ matrix.julia-version }}
|
||||||
- uses: julia-actions/julia-buildpkg@v1
|
- uses: julia-actions/julia-buildpkg@v1
|
||||||
@@ -68,4 +68,4 @@ If the registry contains private packages, or is itself private, the ssh protoco
|
|||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
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.
|
||||||
33
action.yml
33
action.yml
@@ -33,7 +33,7 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
- run: |
|
- run: |
|
||||||
if "${{ inputs.ignore-no-cache }}" == "false" && !isdir(DEPOT_PATH[1])
|
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` ")
|
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
|
end
|
||||||
import Pkg
|
import Pkg
|
||||||
|
|
||||||
@@ -41,25 +41,31 @@ runs:
|
|||||||
VERSION >= v"1.7-" && (ENV["JULIA_PKG_USE_CLI_GIT"] = ${{ inputs.git_cli }})
|
VERSION >= v"1.7-" && (ENV["JULIA_PKG_USE_CLI_GIT"] = ${{ inputs.git_cli }})
|
||||||
|
|
||||||
if VERSION < v"1.7-" && ${{ inputs.git_cli }} == true
|
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)
|
printstyled("::notice::JULIA_PKG_USE_CLI_GIT requires Julia >= 1.7. Using default LibGit2 git-interface instead! \n"; color = :yellow)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
if VERSION >= v"1.5-"
|
if VERSION >= v"1.5-"
|
||||||
if VERSION >= v"1.8-"
|
function reachable_registries()
|
||||||
# Install the default registries
|
return if VERSION >= v"1.7-"
|
||||||
Pkg.Registry.add()
|
Pkg.Registry.reachable_registries()
|
||||||
else
|
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")
|
Pkg.Registry.add("General")
|
||||||
end
|
end
|
||||||
|
|
||||||
# If provided add local registries
|
# If provided add local registries
|
||||||
if !isempty("${{ inputs.localregistry }}")
|
if !isempty(ENV["LOCAL_REGISTRY"])
|
||||||
local_repos = split("${{ inputs.localregistry }}", "\n") .|> string
|
local_repos = split(ENV["LOCAL_REGISTRY"], "\n"; keepempty=false) .|> string
|
||||||
for repo_url in local_repos
|
for repo_url in local_repos
|
||||||
isempty(repo_url) && continue
|
# https://github.com/JuliaLang/Pkg.jl/issues/3753
|
||||||
Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url))
|
if !any(r -> r.repo == repo_url, reachable_registries())
|
||||||
end
|
Pkg.Registry.add(Pkg.RegistrySpec(; url = repo_url))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -68,3 +74,4 @@ runs:
|
|||||||
env:
|
env:
|
||||||
JULIA_PKG_PRECOMPILE_AUTO: "${{ inputs.precompile }}"
|
JULIA_PKG_PRECOMPILE_AUTO: "${{ inputs.precompile }}"
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
LOCAL_REGISTRY: ${{ inputs.localregistry }}
|
||||||
|
|||||||
Reference in New Issue
Block a user