diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28eb529..7132b73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,9 @@ on: tags: '*' jobs: test: + permissions: + contents: read + id-token: write name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} strategy: @@ -32,7 +35,7 @@ jobs: with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 + - uses: actions/cache@v4 env: cache-name: cache-artifacts with: @@ -47,9 +50,12 @@ jobs: env: JULIA_NUM_THREADS: 4 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v5 with: - file: lcov.info + files: lcov.info + # Public fork pull requests use tokenless upload; repository jobs use OIDC. + use_oidc: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} + fail_ci_if_error: true # docs: # name: Documentation # runs-on: ubuntu-latest diff --git a/src/PooledArrays.jl b/src/PooledArrays.jl index ce58ff8..440df74 100644 --- a/src/PooledArrays.jl +++ b/src/PooledArrays.jl @@ -199,8 +199,8 @@ end PooledArray{T}(d, signed=signed, compress=compress) # Construct an empty PooledVector of a specific type -@inline PooledArray(t::Type) = PooledArray(Array(t,0)) -@inline PooledArray(t::Type, r::Type) = PooledArray(Array(t,0), r) +@inline PooledArray(t::Type) = PooledArray(Array{t}(undef,0)) +@inline PooledArray(t::Type, r::Type) = PooledArray(Array{t}(undef,0), r) ############################################################################## ## diff --git a/test/runtests.jl b/test/runtests.jl index f205d73..7ceadd4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -15,6 +15,11 @@ end @testset "PooledArrays" begin @test eltype(PooledArray(Int[])) === Int + @test PooledArray(Int) == Int[] + @test PooledArray(Int) isa PooledVector{Int, UInt32} + @test PooledArray(Int, UInt64) == Int[] + @test PooledArray(Int, UInt64) isa PooledVector{Int, UInt64} + a = rand(10) b = rand(10,10) c = rand(1:10, 1000)