diff --git a/.drone.yml b/.drone.yml index 2607e25..be0eae9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,3 +11,30 @@ steps: image: julia:1.5 commands: - "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'" + +--- +kind: pipeline +name: linux - arm - Julia 1.6 +platform: + os: linux + arch: arm + +steps: +- name: build + image: julia:1.6 + commands: + - "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'" + +--- +kind: pipeline +name: linux - arm64 - Julia 1.6 + +platform: + os: linux + arch: arm64 + +steps: +- name: build + image: julia:1.6 + commands: + - "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..36c5c31 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI +on: + - push + - pull_request +jobs: + test: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.5' + - '1.6' + - 'nightly' + os: + - ubuntu-latest + - macOS-latest + - windows-latest + arch: + - x64 + - x86 + exclude: + - os: macOS-latest + arch: x86 + 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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index edfa080..0000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -## Documentation: http://docs.travis-ci.com/user/languages/julia/ -language: julia -os: - - linux - - osx - - windows -julia: - - 1.0 - - 1 - - 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 - -after_success: - # push coverage results to Codecov - - julia -e 'using Pkg; cd(Pkg.dir("ChrBase")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' diff --git a/Project.toml b/Project.toml index 85ec0e9..fa7eb82 100644 --- a/Project.toml +++ b/Project.toml @@ -4,7 +4,7 @@ keywords = ["Characters"] license = "MIT" desc = "Basic functionality for Chr type" authors = ["ScottPJones "] -version = "1.0.2" +version = "1.0.3" [deps] Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" diff --git a/src/core.jl b/src/core.jl index 5d04faf..1e1ff5a 100644 --- a/src/core.jl +++ b/src/core.jl @@ -79,7 +79,10 @@ rem(x::Chr, ::Type{T}) where {T<:Chr} = (x.v)%T rem(x::Chr, ::Type{T}) where {T<:Char} = (x.v)%T rem(x::Chr, ::Type{T}) where {T<:Number} = (x.v)%T -(::Type{S})(v::T) where {S<:Union{UInt32, Int, UInt}, T<:Chr} = codepoint(v)%S +(::Type{UInt32})(v::Chr) = codepoint(v)%UInt32 +(::Type{UInt64})(v::Chr) = codepoint(v)%UInt64 +(::Type{Int32})(v::Chr) = codepoint(v)%Int32 +(::Type{Int64})(v::Chr) = codepoint(v)%Int64 (::Type{Char})(v::Chr) = Char(codepoint(v)) (::Type{T})(v::Char) where {T<:Chr} = T(codepoint(v))