Skip to content

Commit

Permalink
Prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobnissen committed Oct 21, 2024
1 parent 859907c commit 7ef3eab
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 44 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,16 @@ on:
pull_request:

jobs:
build:
permissions:
contents: write
pull-requests: read
statuses: write
Documenter:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: 'nightly'
- uses: julia-actions/cache@v1
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
version: '1'
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-docdeploy@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # If authenticating with SSH deploy key
run: julia --project=docs/ docs/make.jl
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
27 changes: 14 additions & 13 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,39 @@ on:

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
julia-version:
- 'nightly'
os: [ ubuntu-latest, windows-latest ]
arch: [ x64 ]
julia-version: ['1', '1.11']
os: [ubuntu-latest, macOS-latest, windows-latest]
experimental: [false]
include:
# Include nightly, but experimental, so it's allowed to fail without
# failing CI.
- julia-version: nightly
julia-arch: x86
os: ubuntu-latest
experimental: true
# - julia-version: 1
# os: macOS-latest
# experimental: false
fail_ci_if_error: false

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup Julia
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- name: Run Tests
uses: julia-actions/julia-runtest@latest
- name: Create CodeCov
uses: julia-actions/julia-processcoverage@v1
uses: julia-actions/julia-processcoverage@latest
- name: Upload CodeCov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
file: ./lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}

34 changes: 16 additions & 18 deletions src/PairwiseMappingFormat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,8 @@ function read_buffer!(reader::PAFReader)::Int
remaining = length(mem) - reader.filled
end
end

@assert !iszero(remaining)
# This part annoys me a lot. Julia has no efficient API to read bytes
# into a byte buffer. How on Earth can that be true?
# * read! will throw EOF if the memory is too short, and there is no
Expand All @@ -759,26 +761,22 @@ function read_buffer!(reader::PAFReader)::Int
# It uses bytesavailable to check how many bytes to read and avoid buffer overflows etc,
# and when there are zero bytes available, it reads a single byte, hoping that
# more bytes will be available.
if !iszero(remaining)
n_available = bytesavailable(reader.io)
n_available = bytesavailable(reader.io)
if iszero(n_available) && !eof(reader.io)
# Read one byte and hope more bytes become available
if iszero(n_available) && !eof(reader.io)
byte = read(reader.io, UInt8)
@inbounds mem[reader.filled + 1] = byte
reader.filled += 1
remaining -= 1
n_available = bytesavailable(reader.io)
end
# Read with unsafe_read
n_bytes = min(n_available, remaining)
if !iszero(n_bytes)
GC.@preserve mem unsafe_read(reader.io, pointer(mem, reader.filled + 1), n_bytes)
reader.filled += n_bytes
end
return n_bytes
else
return 0
byte = read(reader.io, UInt8)
@inbounds mem[reader.filled + 1] = byte
reader.filled += 1
remaining -= 1
n_available = bytesavailable(reader.io)
end
# Read with unsafe_read
n_bytes = min(n_available, remaining)
if !iszero(n_bytes)
GC.@preserve mem unsafe_read(reader.io, pointer(mem, reader.filled + 1), n_bytes)
reader.filled += n_bytes
end
return n_bytes
end

"""
Expand Down

2 comments on commit 7ef3eab

@jakobnissen
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/117753

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 7ef3eabba58795f3df68c1f8f6a418e31a7fbf84
git push origin v0.1.0

Please sign in to comment.