Skip to content

Commit f4d7caa

Browse files
committed
Merge branch 'release/v2.3.0'
2 parents d09be57 + 7ebe2c1 commit f4d7caa

6 files changed

Lines changed: 87 additions & 28 deletions

File tree

.github/workflows/CompatHelper.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,43 @@ on:
33
schedule:
44
- cron: 0 0 * * *
55
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
69
jobs:
710
CompatHelper:
811
runs-on: ubuntu-latest
912
steps:
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v1
19+
with:
20+
version: '1'
21+
arch: ${{ runner.arch }}
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_SERVER"] = ""
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
1029
- name: "Install CompatHelper"
1130
run: |
1231
import Pkg
1332
name = "CompatHelper"
1433
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
15-
version = "2"
34+
version = "3"
1635
Pkg.add(; name, uuid, version)
1736
shell: julia --color=yes {0}
1837
- name: "Run CompatHelper"
1938
run: |
2039
import CompatHelper
21-
CompatHelper.main(master_branch = "master")
40+
CompatHelper.main()
2241
shell: julia --color=yes {0}
2342
env:
2443
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2544
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
26-
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
45+
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}

.github/workflows/TagBot.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
name: TagBot
2-
32
on:
43
issue_comment:
54
types:
65
- created
76
workflow_dispatch:
8-
7+
inputs:
8+
lookback:
9+
default: "3"
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
923
jobs:
1024
TagBot:
1125
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
@@ -14,4 +28,6 @@ jobs:
1428
- uses: JuliaRegistries/TagBot@v1
1529
with:
1630
token: ${{ secrets.GITHUB_TOKEN }}
31+
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
1732
ssh: ${{ secrets.DOCUMENTER_KEY }}
33+
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}

.github/workflows/UnitTests.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
- push
55
- pull_request
66

7+
# needed to allow julia-actions/cache to delete old caches that it has created
8+
permissions:
9+
actions: write
10+
contents: read
11+
712
jobs:
813
test:
914
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }} - ${{ github.event_name }}
@@ -13,7 +18,7 @@ jobs:
1318
fail-fast: false
1419
matrix:
1520
julia-version:
16-
- '1.0' # LTS
21+
- '1.6' # LTS
1722
- '1'
1823
julia-arch: [x64, x86]
1924
os: [ubuntu-latest, windows-latest, macOS-latest]
@@ -29,17 +34,23 @@ jobs:
2934

3035
steps:
3136
- name: Checkout Repository
32-
uses: actions/checkout@v2
37+
uses: actions/checkout@v4
3338
- name: Setup Julia
3439
uses: julia-actions/setup-julia@v1
3540
with:
3641
version: ${{ matrix.julia-version }}
42+
arch: ${{ matrix.julia-arch }}
43+
- uses: julia-actions/cache@v1
44+
- uses: julia-actions/julia-buildpkg@v1
3745
- name: Run Tests
3846
uses: julia-actions/julia-runtest@v1
47+
with:
48+
annotate: true
3949
- name: Create CodeCov
4050
uses: julia-actions/julia-processcoverage@v1
4151
- name: Upload CodeCov
42-
uses: codecov/codecov-action@v1
52+
uses: codecov/codecov-action@v4
4353
with:
44-
file: ${{ steps.coverage-processing.outputs.lcov-file }}
45-
fail_ci_if_error: false
54+
files: lcov.info
55+
token: ${{ secrets.CODECOV_TOKEN }}
56+
fail_ci_if_error: false

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Bedgraph"
22
uuid = "0bcc2ff6-69eb-520d-bede-0374fc5bd2fd"
33
authors = ["Ciarán O'Mara <Ciaran.OMara@utas.edu.au>"]
4-
version = "2.2.0"
4+
version = "2.3.0"
55

66
[compat]
77
julia = "0.7, 1"

src/record.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ end
3333

3434
Base.convert(::Type{NamedTuple}, record::Record) = convert(NamedTuple{(:chrom, :first, :last, :value)}, record)
3535

36-
function Base.convert(::Type{Record}, nt::NamedTuple{(:chrom, :first, :last, :value)})
37-
return Record(nt.chrom, nt.first, nt.last, nt.value)
36+
function Base.convert(::Type{T}, nt::NamedTuple{(:chrom, :first, :last, :value),Tuple{String, Int, Int, R}}) where {R <: Real, T<: Bedgraph.Record}
37+
@debug "Convert - strictly named tuples."
38+
return T(nt.chrom, nt.first, nt.last, nt.value)
39+
end
40+
41+
function Base.convert(::Type{T}, nt::NamedTuple{names,Tuple{String, Int, Int, R}}) where {R <: Real, names, T<: Bedgraph.Record}
42+
@debug "Convert - loosely named tuples."
43+
return T(nt[1], nt[2], nt[3], nt[4])
3844
end
3945

4046
function Base.convert(::Type{Record}, str::AbstractString)

test/runtests.jl

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@ end
8484

8585
# Seek test.
8686
open(Bag.file, "r") do io
87+
@info "" readline(io, keep = true)
8788
seek(io, Record)
88-
# @test position(io) == 536 #TOOD: determine why the returned position on windows machines is 545.
89+
@test position(io) == 536 || position(io) == 545 #TODO: determine why the returned position on windows machines is 545.
8990
@test readline(io) == Bag.line1
9091
end
9192

@@ -286,26 +287,32 @@ end #testset Internal Helpers
286287

287288
@testset "NamedTuple" begin
288289

289-
record = Record(Bag.line1)
290+
# Check strictly named fields.
290291

291-
nt = (
292-
chrom = Bag.chroms[1],
293-
first = Bag.firsts[1],
294-
last = Bag.lasts[1],
295-
value = Bag.values[1],
292+
nt_strict_names = (
293+
chrom = Bag.record1.chrom,
294+
first=Bag.record1.first,
295+
last=Bag.record1.last,
296+
value=Bag.record1.value
296297
)
297298

298-
@test record == Record(nt)
299+
@test convert(NamedTuple{(:chrom, :first, :last, :value)}, Bag.record1) == convert(NamedTuple, Bag.record1) == nt_strict_names
300+
@test Bag.record1 == convert(Record, nt_strict_names)
301+
@test Bag.record1 == Record(nt_strict_names)
299302

300-
@test convert(NamedTuple{(:chrom, :first, :last, :value)}, record) == convert(NamedTuple, record) == nt
303+
# Check loosely named fields.
301304

302-
# Check renaming of fields.
303-
@test convert(NamedTuple{(:chrom, :left, :right, :value)}, record) == (
304-
chrom = Bag.chroms[1],
305-
left = Bag.firsts[1],
306-
right = Bag.lasts[1],
307-
value = Bag.values[1],
305+
nt_loose_names = (
306+
chrom = Bag.record1.chrom,
307+
left=Bag.record1.first,
308+
right=Bag.record1.last,
309+
value=Bag.record1.value
308310
)
311+
312+
@test convert(NamedTuple{(:chrom, :left, :right, :value)}, Bag.record1) == nt_loose_names
313+
@test Bag.record1 == convert(Record, nt_loose_names)
314+
@test Bag.record1 == Record(nt_loose_names)
315+
309316
end
310317

311318
end # total testset

0 commit comments

Comments
 (0)