Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 10 additions & 33 deletions .github/workflows/UnitTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version: ['1.0', '1', 'nightly']
julia-version:
- '1.6' # lowest supported julia version declared in `Project.toml`
- '1' # latest release
- 'nightly'
os: [ubuntu-latest]
arch: [x64]
include:
Expand All @@ -24,41 +27,15 @@ jobs:
- os: macOS-latest
julia-version: '1'
arch: x64

env:
REFERENCE_TESTS_STAGING_PATH: "~/mismatches/"
steps:
- uses: actions/checkout@v1.0.0
- uses: actions/checkout@v3
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}

- name: Cache artifacts
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 }}-

# Pkg version resolver isn't smart enough for old Julia versions; we manually aid it.
- name: "Compat fix for Julia < v1.3.0"
if: ${{ matrix.julia-version == '1.0' }}
run: |
using Pkg
Pkg.add([
PackageSpec(name="Reexport", version="0.2"),
PackageSpec(name="Plots", version="1.4.3"),
PackageSpec(name="GR", version="0.50.1"),
PackageSpec(name="DataFrames", version="0.22.7"),
PackageSpec(name="AbstractFFTs", version="0.5"),
])
shell: julia --project=. --startup=no --color=yes {0}
- uses: julia-actions/cache@v1
# rerun the test twice to (1) make sure regeneration works (2) generated references match what's uploaded
- name: "Unit Test"
shell: bash
Expand All @@ -68,12 +45,12 @@ jobs:
julia --color=yes --check-bounds=yes --project -e "using Pkg; Pkg.test(coverage=true)"
julia --color=yes --check-bounds=yes --project -e "using Pkg; Pkg.test(coverage=true)"
- name: Upload Mismatched Files as a Build Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: "Mismatched Files"
path: "~/mismatches/"

- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: julia-actions/julia-processcoverage@latest
- uses: codecov/codecov-action@v3
with:
file: lcov.info
12 changes: 6 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ DeepDiffs = "ab62b9b5-e342-54a8-a765-a90f495de1a6"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
ImageInTerminal = "d8c32880-2388-543b-8c61-d9f865259254"
LazyModules = "8cdb02fc-e678-4876-92c5-9defec4f444e"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
XTermColors = "c8c2cc18-de81-4e68-b407-38a3a0c0491f"

[compat]
BSON = "0.3"
Colors = "0.10, 0.11, 0.12"
Colors = "0.10 - 0.12"
CSVFiles = "1"
DataFrames = "0.21, 0.22"
DataFrames = "0.21 - 0.22"
DeepDiffs = "1.1"
Distances = "0.7, 0.8, 0.9, 0.10"
Distances = "0.7 - 0.10"
FileIO = "1"
GR = "= 0.50.1"
ImageCore = "0.8.1, 0.9"
ImageInTerminal = "0.3, 0.4, 0.5"
ImageMagick = "0.7, 1"
ImageTransformations = "0.8"
LazyModules = "0.3"
Plots = "= 1.4.3"
TestImages = "0.6, 1"
julia = "1"
XTermColors = "0.2"
julia = "1.6"

[extras]
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
Expand Down
2 changes: 1 addition & 1 deletion src/ReferenceTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using Colors
using Distances
using FileIO
@lazy import ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
@lazy import ImageInTerminal = "d8c32880-2388-543b-8c61-d9f865259254"
@lazy import XTermColors = "c8c2cc18-de81-4e68-b407-38a3a0c0491f"
using SHA
using DeepDiffs
using Random
Expand Down
9 changes: 5 additions & 4 deletions src/fileio.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ function _convert(
size = (20,40), kw...)

# encode image into string
strs = @withcolor ImageInTerminal.encodeimg(
ImageInTerminal.SmallBlocks(),
ImageInTerminal.TermColor256(),
strs = @withcolor XTermColors.ascii_show(
img,
size...)[1]
XTermColors.TermColor8bit(),
:small,
size
)
return join(strs,'\n')
end

Expand Down
7 changes: 6 additions & 1 deletion src/render.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ function render_item(::BeforeAfterLimited, item)
println()
end
function render_item(::BeforeAfterImage, item)
str_item = @withcolor ImageInTerminal.encodeimg(ImageInTerminal.SmallBlocks(), ImageInTerminal.TermColor256(), item, 20, 40)[1]
str_item = @withcolor XTermColors.ascii_show(
item,
XTermColors.TermColor8bit(),
:small,
(20, 40)
)
println("eltype: ", eltype(item))
println("size: ", map(length, axes(item)))
println("thumbnail:")
Expand Down
10 changes: 5 additions & 5 deletions test/references/camera.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀
▀▀▀▀▀▀▀▀▀
Loading