Skip to content

Commit deeaeec

Browse files
authored
Merge pull request #22 from JuliaString/spj/update
Update CI
2 parents 586f13c + 64a66ec commit deeaeec

File tree

6 files changed

+79
-51
lines changed

6 files changed

+79
-51
lines changed

.drone.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
---
22
kind: pipeline
3-
name: linux - arm - Julia 1.0
3+
name: linux - arm64 - Julia 1.5
44

55
platform:
66
os: linux
7-
arch: arm
7+
arch: arm64
88

99
steps:
1010
- name: build
11-
image: julia:1.0
11+
image: julia:1.5
1212
commands:
1313
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"
1414

1515
---
1616
kind: pipeline
17-
name: linux - arm64 - Julia 1.0
17+
name: linux - arm - Julia 1.6
1818

1919
platform:
2020
os: linux
21-
arch: arm64
21+
arch: arm
2222

2323
steps:
2424
- name: build
25-
image: julia:1.0
25+
image: julia:1.6
2626
commands:
2727
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"
2828

2929
---
3030
kind: pipeline
31-
name: linux - arm64 - Julia 1.5
31+
name: linux - arm64 - Julia 1.6
3232

3333
platform:
3434
os: linux
3535
arch: arm64
3636

3737
steps:
3838
- name: build
39-
image: julia:1.5
39+
image: julia:1.6
4040
commands:
4141
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
test:
7+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
version:
13+
- '1.5'
14+
- '1.6'
15+
- 'nightly'
16+
os:
17+
- ubuntu-latest
18+
- macOS-latest
19+
- windows-latest
20+
arch:
21+
- x64
22+
- x86
23+
exclude:
24+
- os: macOS-latest
25+
arch: x86
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: julia-actions/setup-julia@v1
29+
with:
30+
version: ${{ matrix.version }}
31+
arch: ${{ matrix.arch }}
32+
- uses: actions/cache@v1
33+
env:
34+
cache-name: cache-artifacts
35+
with:
36+
path: ~/.julia/artifacts
37+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
38+
restore-keys: |
39+
${{ runner.os }}-test-${{ env.cache-name }}-
40+
${{ runner.os }}-test-
41+
${{ runner.os }}-
42+
- uses: julia-actions/julia-buildpkg@v1
43+
- uses: julia-actions/julia-runtest@v1

.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ keywords = ["Entities", "Unicode"]
44
license = "MIT"
55
name = "Unicode_Entities"
66
uuid = "a8aa15d3-c567-5e9f-b6cc-4b0f97f09cf7"
7-
version = "1.1.0"
7+
version = "1.1.1"
88

99
[deps]
1010
StrTables = "9700d1a9-a7c8-5760-9816-a99fda30bb8f"

deps/build.jl

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using StrTables
44

55
const VER = UInt32(1)
66

7-
const datapath = "../data"
7+
const datapath = joinpath(@__DIR__, "..", "data")
88
const dpath = "https://www.unicode.org/Public/UCD/latest/ucd/"
99
const inpname = "UnicodeData.txt"
1010
const fname = "unicode.dat"
@@ -48,10 +48,15 @@ function load_unicode_data(datapath, dpath, fname)
4848
println("Loading Unicode Data: ", lname)
4949
src = lname
5050
else
51-
src = string(dpath, fname)
52-
println("Downloading Unicode Data: ", src)
53-
download(src, lname)
54-
println("Saved to: ", lname)
51+
try
52+
src = string(dpath, fname)
53+
println("Downloading Unicode Data: ", src)
54+
download(src, lname)
55+
println("Saved to: ", lname)
56+
catch ex
57+
println("Unable to download $src and save in $lname")
58+
rethrow(ex)
59+
end
5560
end
5661
symnam = String[]
5762
symval = UInt32[]
@@ -280,10 +285,10 @@ else
280285
try
281286
global tup
282287
tup = make_tables(datapath, dpath, inpname)
288+
println("Saving tables to ", savfile)
289+
StrTables.save(savfile, tup)
290+
println("Done")
283291
catch ex
284292
println(sprint(showerror, ex, catch_backtrace()))
285293
end
286-
println("Saving tables to ", savfile)
287-
StrTables.save(savfile, tup)
288-
println("Done")
289294
end

test/runtests.jl

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
using StrTables, Unicode_Entities
22

3-
@static VERSION < v"0.7.0-DEV" ? (using Base.Test) : (using Test)
3+
using Test
44

55
# Test the functions lookupname, matches, longestmatches, completions
66
# Check that characters from all 3 tables (BMP, non-BMP, 2 character) are tested
77

88
const def = Unicode_Entities.default
99

10-
const datapath = "../data"
10+
const datapath = joinpath(pathof(Unicode_Entities), "data")
1111
const dpath = "ftp://ftp.unicode.org/Public/UNIDATA/"
1212
const fname = "UnicodeData.txt"
1313

@@ -17,7 +17,15 @@ const symval = Vector{Char}()
1717
"""Load up all names and characters from original data file"""
1818
function load_unicode_data()
1919
lname = joinpath(datapath, fname)
20-
isfile(lname) || download(string(dpath, fname), lname)
20+
if !isfile(lname)
21+
try
22+
lname = download(string(dpath, fname), lname)
23+
catch ex
24+
println("Error loading \"$(string(dpath, fname))\" and saving in \"$lname\"")
25+
println(sprint(showerror, ex, catch_backtrace()))
26+
return false
27+
end
28+
end
2129
aliasnam = Vector{String}()
2230
aliasval = Vector{Char}()
2331
open(lname, "r") do f
@@ -48,13 +56,11 @@ function load_unicode_data()
4856
push!(symval, ch)
4957
end
5058
end
59+
true
5160
end
5261

53-
load_unicode_data()
54-
5562
@testset "Unicode_Entities" begin
56-
57-
@testset "matches data file" begin
63+
if load_unicode_data() @testset "matches data file" begin
5864
for (i, ch) in enumerate(symval)
5965
list = matchchar(def, ch)
6066
if !isempty(list)
@@ -68,6 +74,7 @@ load_unicode_data()
6874
end
6975
end
7076
end
77+
end
7178

7279
@testset "lookupname" begin
7380
@test lookupname(def, "foobar") == ""

0 commit comments

Comments
 (0)