Skip to content

Commit 5cb70b1

Browse files
authored
drop julia < 1.0 support, update to github CI (#54)
* update to github CI * add missing Test dependency in Project.toml, version bump * rm pre-1.0 support cruft * whoops, restore missing imports
1 parent 032c158 commit 5cb70b1

File tree

6 files changed

+92
-57
lines changed

6 files changed

+92
-57
lines changed

.github/workflows/CI.yml

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
# Run on master, tags, or any pull request
3+
on:
4+
schedule:
5+
- cron: '0 2 * * *' # Daily at 2 AM UTC (8 PM CST)
6+
push:
7+
branches: [master]
8+
tags: ["*"]
9+
pull_request:
10+
concurrency:
11+
# Skip intermediate builds: always.
12+
# Cancel intermediate builds: only if it is a pull request build.
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
15+
jobs:
16+
test:
17+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
version:
23+
- "1.0" # LTS
24+
- "1" # Latest Release
25+
os:
26+
- ubuntu-latest
27+
- macOS-latest
28+
- windows-latest
29+
arch:
30+
- x64
31+
- x86
32+
exclude:
33+
# Test 32-bit only on Linux
34+
- os: macOS-latest
35+
arch: x86
36+
- os: windows-latest
37+
arch: x86
38+
include:
39+
# Add specific version used to run the reference tests.
40+
# Must be kept in sync with version check in `test/runtests.jl`,
41+
# and with the branch protection rules on the repository which
42+
# require this specific job to pass on all PRs
43+
# (see Settings > Branches > Branch protection rules).
44+
- os: ubuntu-latest
45+
version: 1.7.2
46+
arch: x64
47+
steps:
48+
- uses: actions/checkout@v2
49+
- uses: julia-actions/setup-julia@v1
50+
with:
51+
version: ${{ matrix.version }}
52+
arch: ${{ matrix.arch }}
53+
- uses: actions/cache@v2
54+
env:
55+
cache-name: cache-artifacts
56+
with:
57+
path: ~/.julia/artifacts
58+
key: ${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
59+
restore-keys: |
60+
${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}-
61+
${{ runner.os }}-${{ matrix.arch }}-test-
62+
${{ runner.os }}-${{ matrix.arch }}-
63+
${{ runner.os }}-
64+
- uses: julia-actions/julia-buildpkg@latest
65+
- run: |
66+
git config --global user.name Tester
67+
git config --global user.email [email protected]
68+
- uses: julia-actions/julia-runtest@latest
69+
- uses: julia-actions/julia-processcoverage@v1
70+
- uses: codecov/codecov-action@v2
71+
with:
72+
files: lcov.info

Project.toml

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name = "LegacyStrings"
22
uuid = "1b4a561d-cfcb-5daf-8433-43fcf8b4bea3"
3-
version = "1.0"
4-
5-
[deps]
6-
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
3+
version = "1.1"
74

85
[compat]
9-
Compat = "0.67, 0.68, 0.69, 0.70, 1, 2, 3, 4"
106
julia = "1"
7+
8+
[extras]
9+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
10+
11+
[targets]
12+
test = ["Test"]

README.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
# LegacyStrings
22

3-
[![Travis CI Build Status](https://travis-ci.org/JuliaStrings/LegacyStrings.jl.svg?branch=master)](https://travis-ci.org/JuliaStrings/LegacyStrings.jl)
4-
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/ib52329urgg62jai?svg=true)](https://ci.appveyor.com/project/nalimilan/legacystrings-jl)
5-
6-
[![Julia 0.5 Status](http://pkg.julialang.org/badges/LegacyStrings_0.5.svg)](http://pkg.julialang.org/?pkg=LegacyStrings&ver=0.5)
7-
[![Julia 0.6 Status](http://pkg.julialang.org/badges/LegacyStrings_0.6.svg)](http://pkg.julialang.org/?pkg=LegacyStrings&ver=0.6)
8-
[![Julia 0.7 Status](http://pkg.julialang.org/badges/LegacyStrings_0.7.svg)](http://pkg.julialang.org/?pkg=LegacyStrings&ver=0.7)
3+
[![CI](https://github.com/JuliaStrings/LegacyStrings.jl/workflows/CI/badge.svg)](https://github.com/JuliaStrings/LegacyStrings.jl/actions?query=workflow%3ACI)
94

105
The LegacyStrings package provides compatibility string types from Julia 0.5 (and earlier), which were removed in subsequent versions, including:
116

REQUIRE

-2
This file was deleted.

src/LegacyStrings.jl

+6-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# This file includes code that was formerly a part of Julia. License is MIT: http://julialang.org/license
22

3-
__precompile__(true)
4-
53
module LegacyStrings
64

75
export
@@ -23,14 +21,18 @@ export
2321
using Base: @propagate_inbounds
2422

2523
import Base:
24+
codeunit,
2625
containsnul,
2726
convert,
2827
getindex,
2928
isascii,
3029
isvalid,
30+
iterate,
31+
lastindex,
3132
length,
3233
lowercase,
3334
map,
35+
ncodeunits,
3436
nextind,
3537
pointer,
3638
prevind,
@@ -43,28 +45,8 @@ import Base:
4345
uppercase,
4446
write
4547

46-
using Compat
47-
using Compat: IOBuffer
48-
import Compat:
49-
lastindex,
50-
codeunit,
51-
ncodeunits
52-
53-
54-
if VERSION < v"0.7-"
55-
import Base: lcfirst
56-
import Base: next
57-
import Base: rsearch
58-
import Base: search
59-
import Base: ucfirst
60-
import Base: UnicodeError
61-
using Base: DirectIndexString
62-
else
63-
import Base: iterate
64-
include("unicodeerror.jl")
65-
include("directindex.jl")
66-
end
67-
48+
include("unicodeerror.jl")
49+
include("directindex.jl")
6850

6951
struct ASCIIString <: DirectIndexString
7052
data::Vector{UInt8}

test/runtests.jl

+6-20
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# This file includes code that was formerly a part of Julia. License is MIT: http://julialang.org/license
22

3-
using Compat
4-
using Compat.Test
5-
using Compat: view, String
3+
using Test
64
using LegacyStrings
75
using LegacyStrings: ASCIIString, UTF8String # override Compat's version
86
import LegacyStrings:
@@ -207,11 +205,8 @@ let ch = 0x10000
207205
end
208206

209207
let str = UTF8String(b"this is a test\xed\x80")
210-
@static if VERSION < v"0.7-"
211-
@test next(str, 15) == ('\ufffd', 16)
212-
else
213-
@test iterate(str, 15) == ('\ufffd', 16)
214-
end
208+
@test iterate(str, 15) == ('\ufffd', 16)
209+
215210
@test_throws BoundsError getindex(str, 0:3)
216211
@test_throws BoundsError getindex(str, 17:18)
217212
@test_throws BoundsError getindex(str, 2:17)
@@ -548,20 +543,11 @@ let
548543

549544
@test lastindex(srep) == 7
550545

551-
@static if VERSION < v"0.7-"
552-
@test next(srep, 3) == ('β',5)
553-
@test next(srep, 7) == ('β',9)
554-
else
555-
@test iterate(srep, 3) == ('β',5)
556-
@test iterate(srep, 7) == ('β',9)
557-
end
546+
@test iterate(srep, 3) == ('β',5)
547+
@test iterate(srep, 7) == ('β',9)
558548

559549
@test srep[7] == 'β'
560-
@static if VERSION < v"0.7.0-DEV.2924"
561-
@test_throws BoundsError srep[8]
562-
else
563-
@test_throws StringIndexError srep[8]
564-
end
550+
@test_throws StringIndexError srep[8]
565551
end
566552

567553

0 commit comments

Comments
 (0)