Compare commits

..

10 Commits

Author SHA1 Message Date
Ian Butterworth
252d4686a5 Fix add_general_registry (#28) 2022-12-20 11:52:13 +01:00
Ian Butterworth
f813042500 Detect if the registry is already installed via tarball (#25) 2022-12-19 01:16:36 +01:00
Ian Butterworth
139ec78da3 Disable autoprecompile by default (#26) 2022-12-17 18:35:44 +01:00
Rik Huijzer
6d50efe063 Suggest using releases instead of master (#18) 2022-02-11 14:40:27 +01:00
Curtis Vogt
f995fa4149 Support setting the Julia project (#15) 2021-07-08 13:01:30 +02:00
Dilum Aluthge
1b0a69ab74 Put the General registry clone inside a bounded retry loop (#13)
Co-authored-by: Sascha Mann <git@mail.saschamann.eu>
2021-01-04 11:30:54 +01:00
Sascha Mann
69b7cba4e2 Add automated backup workflow (#11) 2020-12-19 13:29:12 +01:00
Sascha Mann
3240c50307 [CI] Don't trigger builds on doc changes (#9) 2020-12-15 19:55:59 +01:00
Dilum Aluthge
1b7e283276 Make the @julia-actions/reviewers the global code owners for this repo (#10) 2020-12-14 14:31:09 +01:00
Sascha Mann
fb1158438d Add basic end-to-end test (#8)
(fixes https://github.com/julia-actions/julia-runtest/issues/25)
2020-12-09 00:56:13 +01:00
6 changed files with 210 additions and 12 deletions

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @julia-actions/reviewers

33
.github/workflows/backup.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Backup
on:
schedule:
- cron: '5 4 * * 0'
workflow_dispatch:
jobs:
backup:
runs-on: ubuntu-20.04
steps:
- name: Configure cache
uses: actions/cache@v2
with:
path: |
${{ env.GITHUB_WORKSPACE }}
~/.cache/restic
key: ${{ runner.os }}
- name: Install the correct Python version
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Run backup action
uses: julia-actions/restic-action@main
env: # Options: https://restic.readthedocs.io/en/latest/040_backup.html#environment-variables
RESTIC_REPOSITORY: b2:${{ secrets.B2_BUCKET }}:${{ github.repository }}
RESTIC_PASSWORD: ${{ secrets.RESTIC_PASSWORD }}
B2_ACCOUNT_ID: ${{ secrets.B2_ACCOUNT_ID }}
B2_ACCOUNT_KEY: ${{ secrets.B2_ACCOUNT_KEY }}

86
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,86 @@
name: CI
on:
push:
branches:
- "main"
- "master"
paths-ignore:
- "README.md"
- "LICENSE"
pull_request:
paths-ignore:
- "README.md"
- "LICENSE"
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- "1.0"
- "1" # automatically expands to the latest stable 1.x release of Julia
- nightly
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
- x86
pkg-server:
- ""
- "pkg.julialang.org"
# 32-bit Julia binaries are not available on macOS
exclude:
- os: macOS-latest
arch: x86
steps:
- name: Checkout Example.jl
uses: actions/checkout@v2
with:
repository: julia-actions/Example.jl
- name: Verify that test output file does not exist yet
run: test ! -f "$HOME/julia-buildpkg"
shell: bash
- name: Checkout julia-buildpkg
uses: actions/checkout@v2
with:
path: ./.github/actions/julia-buildpkg
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
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
env:
JULIA_PKG_SERVER: ${{ matrix.pkg-server }}
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
- name: Verify that test output file exists
run: test -f "$HOME/julia-buildpkg"
shell: bash

View File

@@ -26,10 +26,10 @@ jobs:
julia-arch: x86
steps:
- uses: actions/checkout@v1.0.0
- uses: julia-actions/setup-julia@latest
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/julia-buildpkg@master
- uses: julia-actions/julia-runtest@master
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
```

View File

@@ -6,6 +6,14 @@ branding:
icon: 'box'
color: 'gray-dark'
inputs:
project:
description: 'Value passed to the --project flag. The default value is the repository root: "@."'
default: '@.'
precompile:
description: 'Whether to allow auto-precompilation (via the `JULIA_PKG_PRECOMPILE_AUTO` env var). Options: yes | no. Default value: no.'
default: 'no'
runs:
using: 'composite'
steps:
@@ -17,13 +25,10 @@ runs:
# * https://github.com/JuliaLang/Pkg.jl/issues/2011
# * https://github.com/JuliaRegistries/General/issues/16777
# * https://github.com/JuliaPackaging/PkgServer.jl/issues/60
- run: julia --color=yes -e 'using Pkg; VERSION >= v"1.5-" && !isdir(joinpath(DEPOT_PATH[1], "registries", "General")) && Pkg.Registry.add("General")'
- run: julia --color=yes "$GITHUB_ACTION_PATH"/add_general_registry.buildpkg.jl
shell: bash
- run: julia --color=yes --project=${{ inputs.project }} -e 'using Pkg; if VERSION >= v"1.1.0-rc1"; Pkg.build(verbose=true); else Pkg.build(); end'
shell: bash
env:
# We set `JULIA_PKG_SERVER` only for this step to enforce
# `Pkg.Registry.add` to use Git. This way, Pkg.jl can send
# the request metadata to pkg.julialang.org when installing
# packages via `Pkg.test`.
JULIA_PKG_SERVER: ""
- run: julia --color=yes --project -e 'using Pkg; if VERSION >= v"1.1.0-rc1"; Pkg.build(verbose=true); else Pkg.build(); end'
shell: bash
JULIA_PKG_PRECOMPILE_AUTO: "${{ inputs.precompile }}"

View File

@@ -0,0 +1,73 @@
using Pkg
function tarball_general_registry_location()
reg_dir = joinpath(DEPOT_PATH[1], "registries")
general_registry_tarball = joinpath(reg_dir, "General.tar.gz")
registry_toml_file = joinpath(reg_dir, "General.toml")
return general_registry_tarball, registry_toml_file
end
function cloned_general_registry_location()
general_registry_dir = joinpath(DEPOT_PATH[1], "registries", "General")
registry_toml_file = joinpath(general_registry_dir, "Registry.toml")
return general_registry_dir, registry_toml_file
end
function general_registry_exists()
general_registry_tarball, registry_toml_file = tarball_general_registry_location()
if isfile(general_registry_tarball) && isfile(registry_toml_file)
return true
end
general_registry_dir, registry_toml_file = cloned_general_registry_location()
if isdir(general_registry_dir) && isfile(registry_toml_file)
return true
end
return false
end
function add_general_registry()
@info("Attempting to install the General registry")
general_registry_tarball, registry_toml_file = tarball_general_registry_location()
rm(general_registry_tarball; force = true, recursive = true)
rm(registry_toml_file; force = true, recursive = true)
general_registry_dir, registry_toml_file = cloned_general_registry_location()
rm(general_registry_dir; force = true, recursive = true)
# If not already set, We set `JULIA_PKG_SERVER` to enforce
# `Pkg.Registry.add` to use Git. This way, Pkg.jl can send
# the request metadata to pkg.julialang.org when installing
# packages via `Pkg.test`.
pkg_server = get(ENV, "JULIA_PKG_SERVER", "")
withenv("JULIA_PKG_SERVER" => pkg_server) do
Pkg.Registry.add("General")
end
general_registry_exists() || throw(ErrorException("The Registry was not intalled properly"))
return nothing
end
function main(; n = 10, max_delay = 120)
VERSION >= v"1.5-" || return
if general_registry_exists()
@info("The General registry already exists locally")
return
end
delays = ExponentialBackOff(; n = n, max_delay = max_delay)
try
retry(add_general_registry; delays = delays)()
@info("Successfully added the General registry")
catch ex
msg = "I was unable to add the General registry. However, the build will continue."
@error(msg, exception=(ex,catch_backtrace()))
end
return
end
main()