Skip to content

Commit

Permalink
Merge pull request #10 from JuliaArrays/massinstallaction/set-up-CI
Browse files Browse the repository at this point in the history
Switch to GitHub Actions for CI, fix an ambiguity
  • Loading branch information
timholy authored Jan 17, 2021
2 parents 7e0fa19 + 57d96c3 commit 064e211
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 66 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI
on:
pull_request:
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:
- '0.7'
- '1.0'
- '1'
# - 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-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
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

44 changes: 0 additions & 44 deletions appveyor.yml

This file was deleted.

6 changes: 3 additions & 3 deletions src/bidirectional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ Base.axes( v::BidirectionalVector) = (Base.axes1(v),)
Base.size( v::BidirectionalVector) = (length(v),)
Base.length(v::BidirectionalVector) = length(v.data)

function Base.similar(v::AbstractArray, T::Type, inds::Tuple{URange})
function Base.similar(::AbstractArray, ::Type{T}, inds::Tuple{URange}) where T
inds1 = inds[1]
n = length(inds1)
BidirectionalVector(Array{T}(undef, n), first(inds1)-1)
end

function Base.similar(f::Union{Function,Type}, inds::Tuple{URange})
function Base.similar(::Type{T}, inds::Tuple{URange}) where T<:AbstractArray
inds1 = inds[1]
n = length(inds1)
BidirectionalVector(f(Base.OneTo(n)), first(inds1)-1)
BidirectionalVector(T(Base.OneTo(n)), first(inds1)-1)
end

@inline function Base.getindex(v::BidirectionalVector, i::Int)
Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ using Test

### BidirectionalVector
@testset "CatIndices" begin
if Base.VERSION >= v"1.6.0-DEV.1005"
@test isempty(detect_ambiguities(CatIndices))
end
function checkvals(v)
for i in axes(v,1)
@test v[i] == i
Expand Down

0 comments on commit 064e211

Please sign in to comment.