Skip to content

Commit

Permalink
Fix CI run and resolve errors (#19)
Browse files Browse the repository at this point in the history
* Fix YAML error in CI workflow file

* Bump ZipFile lower bound to v0.8.3

This release resolved an ambiguity issue

* Bump minimum Julia version to v1.3

* Increment patch number

* Run CI on pre-releases instead of nightlies

* Revert "Run CI on pre-releases instead of nightlies"

This reverts commit b784bdf.
  • Loading branch information
sethaxen authored Aug 29, 2024
1 parent 4d0b398 commit 34119d6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: ${{ matrix.downgrade && 'Downgrade / ' || '' }}Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }}
name: ${{ matrix.downgrade && 'Downgrade / ' || '' }}Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.0' # minimum supported version
- '1.3' # minimum version with default database
- '1.3'
- '1'
- 'nightly'
os:
Expand Down
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PosteriorDB"
uuid = "1c4bc282-d2f5-44f9-b6d1-8c4424a23ad4"
authors = ["Seth Axen <seth@sethaxen.com> and contributors"]
version = "0.5.1"
version = "0.5.2"

[deps]
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
Expand All @@ -17,8 +17,8 @@ Compat = "3, 4"
JSON3 = "1"
OrderedCollections = "1"
Test = "<0.0.1, 1"
ZipFile = "0.8, 0.9, 0.10"
julia = "1"
ZipFile = "0.8.3, 0.9, 0.10"
julia = "1.3"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
Expand Down
2 changes: 1 addition & 1 deletion src/PosteriorDB.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module PosteriorDB
using JSON3, ZipFile
using OrderedCollections: OrderedDict
using Compat: stack
VERSION v"1.3" && using Artifacts
using Artifacts

include("utils.jl")
include("common.jl")
Expand Down
15 changes: 4 additions & 11 deletions src/posterior_database.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,10 @@ used.
database
database(path::String) = PosteriorDatabase(path)

@static if VERSION v"1.3"
function database()
artifact_path = artifact"posteriordb"
path = joinpath(artifact_path, readdir(artifact_path)[1], "posterior_database")
return database(path)
end
else
function database()
@error "On Julia versions < 1.3, the path to the posterior database must be provided. A copy can be downloaded from https://github.com/stan-dev/posteriordb."
return throw(MethodError(database, ()))
end
function database()
artifact_path = artifact"posteriordb"
path = joinpath(artifact_path, readdir(artifact_path)[1], "posterior_database")
return database(path)
end

Base.show(io::IO, ::PosteriorDatabase) = print(io, "PosteriorDatabase(...)")
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ POSTERIOR_DB_PATH = get(ENV, "POSTERIOR_DB_PATH", "")
@testset "PosteriorDatabase" begin
@test pdb isa PosteriorDB.PosteriorDatabase
@test isdir(PosteriorDB.path(pdb))
VERSION < v"1.3" && @test_throws MethodError PosteriorDB.database()
end

@testset "posterior" begin
Expand Down

0 comments on commit 34119d6

Please sign in to comment.