diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 00000000..4997fa10 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,48 @@ +name: CI +on: + pull_request: + branches: + - master + push: + branches: + - master + tags: '*' +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.0' + - '1' + - 'nightly' + os: + - ubuntu-latest + - windows-latest + - macos-latest + arch: + - x64 + steps: + - uses: actions/checkout@v2 + - 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: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1e3c87c2..00000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -## Documentation: http://docs.travis-ci.com/user/languages/julia/ -language: julia -os: - - linux - - osx -julia: - - 1.0 - - 1.4 - - 1.5 - - nightly -notifications: - email: false -git: - depth: 99999999 - -## uncomment the following lines to allow failures on nightly julia -## (tests will run but not make your overall status red) -matrix: - allow_failures: - - julia: nightly - -## uncomment and modify the following lines to manually install system packages -#addons: -# apt: # apt-get for linux -# packages: -# - gfortran -#before_script: # homebrew for mac -# - if [ $TRAVIS_OS_NAME = osx ]; then brew install gcc; fi - -## uncomment the following lines to override the default test script -#script: -# - julia -e 'Pkg.clone(pwd()); Pkg.build("StructArrays"); Pkg.test("StructArrays"; coverage=true)' -after_success: - # push coverage results to Coveralls - - julia -e 'import Pkg; cd(Pkg.dir("StructArrays")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())' - # push coverage results to Codecov - - julia -e 'import Pkg; cd(Pkg.dir("StructArrays")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' diff --git a/README.md b/README.md index ff2dba49..a65bf48c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # StructArrays -[![Build Status](https://travis-ci.org/JuliaArrays/StructArrays.jl.svg?branch=master)](https://travis-ci.org/JuliaArrays/StructArrays.jl) +[![CI](https://github.com/JuliaArrays/StructArrays.jl/workflows/CI/badge.svg?branch=master)](https://github.com/JuliaArrays/StructArrays.jl/actions?query=workflow%3ACI+branch%3Amaster) [![codecov.io](http://codecov.io/github/JuliaArrays/StructArrays.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaArrays/StructArrays.jl?branch=master) This package introduces the type `StructArray` which is an `AbstractArray` whose elements are `struct` (for example `NamedTuples`, or `ComplexF64`, or a custom user defined `struct`). While a `StructArray` iterates `structs`, the layout is column based (meaning each field of the `struct` is stored in a separate `Array`). diff --git a/test/runtests.jl b/test/runtests.jl index eed11afe..2558cd53 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -628,12 +628,19 @@ end io = IOBuffer() Base.showarg(io, rows, true) str = String(take!(io)) - @test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2}) with eltype LazyRow{Complex{Float64}}" + if VERSION < v"1.6-" + @test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2}) with eltype LazyRow{Complex{Float64}}" + else + @test str == "LazyRows(::Matrix{Float64}, ::Matrix{Float64}) with eltype LazyRow{ComplexF64}" + end io = IOBuffer() Base.showarg(io, rows, false) str = String(take!(io)) - @test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2})" - + if VERSION < v"1.6-" + @test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2})" + else + @test str == "LazyRows(::Matrix{Float64}, ::Matrix{Float64})" + end s = StructArray((rand(10, 10), rand(10, 10))) rows = LazyRows(s) @test IndexStyle(rows) isa IndexLinear @@ -653,11 +660,19 @@ end io = IOBuffer() Base.showarg(io, rows, true) str = String(take!(io)) - @test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2}) with eltype LazyRow{Tuple{Float64,Float64}}" + if VERSION < v"1.6-" + @test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2}) with eltype LazyRow{Tuple{Float64,Float64}}" + else + @test str == "LazyRows(::Matrix{Float64}, ::Matrix{Float64}) with eltype LazyRow{Tuple{Float64, Float64}}" + end io = IOBuffer() Base.showarg(io, rows, false) str = String(take!(io)) - @test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2})" + if VERSION < v"1.6-" + @test str == "LazyRows(::Array{Float64,2}, ::Array{Float64,2})" + else + @test str == "LazyRows(::Matrix{Float64}, ::Matrix{Float64})" + end end @testset "refarray" begin @@ -687,11 +702,19 @@ end io = IOBuffer() Base.showarg(io, s, true) str = String(take!(io)) - @test str == "StructArray(::Array{Int64,1}, ::Array{Int64,1}) with eltype Complex{Int64}" + if VERSION < v"1.6-" + @test str == "StructArray(::Array{Int64,1}, ::Array{Int64,1}) with eltype Complex{Int64}" + else + @test str == "StructArray(::Vector{Int64}, ::Vector{Int64}) with eltype Complex{Int64}" + end io = IOBuffer() Base.showarg(io, s, false) str = String(take!(io)) - @test str == "StructArray(::Array{Int64,1}, ::Array{Int64,1})" + if VERSION < v"1.6-" + @test str == "StructArray(::Array{Int64,1}, ::Array{Int64,1})" + else + @test str == "StructArray(::Vector{Int64}, ::Vector{Int64})" + end end @testset "append!!" begin