Skip to content

Commit

Permalink
github ci (#83)
Browse files Browse the repository at this point in the history
* github ci
  • Loading branch information
PhilipVinc authored Nov 17, 2020
1 parent f60a9fe commit 07fa2a7
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 83 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Documentation

on:
push:
branches:
- master
tags: '*'
pull_request:

jobs:
docs-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate(); Pkg.build(;verbose=true)'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia --project=docs/ docs/make.jl
53 changes: 53 additions & 0 deletions .github/workflows/UnitTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Unit Tests

on:
pull_request:

push:
branches:
- master

jobs:
Test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
julia_version: ["1.0", "1", "nightly"]
exclude:
- os: macos-latest
julia_version: '1.0'

runs-on: ${{ matrix.os }}
env:
MPICH_INTERFACE_HOSTNAME: localhost
JULIA_MPIEXEC_ARGS: ${{ matrix.mpiexec_args }}

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Julia
uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia_version }}

# https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484
- 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 }}-
- name: Disable broken dependencies on old Julia v1.0
if: matrix.julia_version == '1.0'
run: cp compat/Project.toml Project.toml

- uses: julia-actions/julia-runtest@latest

42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TensorBoardLogger"
uuid = "899adc3e-224a-11e9-021f-63837185c80f"
authors = ["Filippo Vicentini <filippovicentini@gmail.com>"]
version = "0.1.11"
version = "0.1.12"

[deps]
CRC32c = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TensorBoardLogger
[![Build Status](https://travis-ci.org/PhilipVinc/TensorBoardLogger.jl.svg?branch=master)](https://travis-ci.org/PhilipVinc/TensorBoardLogger.jl) [![codecov](https://codecov.io/gh/PhilipVinc/TensorBoardLogger.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/PhilipVinc/TensorBoardLogger.jl)
[![codecov](https://codecov.io/gh/PhilipVinc/TensorBoardLogger.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/PhilipVinc/TensorBoardLogger.jl)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://philipvinc.github.io/TensorBoardLogger.jl/dev/)

**TensorBoardLogger.jl** is a native library for logging arbitrary data to
Expand Down
38 changes: 38 additions & 0 deletions compat/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name = "TensorBoardLogger"
uuid = "899adc3e-224a-11e9-021f-63837185c80f"
authors = ["Filippo Vicentini <filippovicentini@gmail.com>"]
version = "0.1.12"

[deps]
CRC32c = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93"
ImageCore = "a09fc81d-aa75-5fe9-8630-4744c3626534"
ProtoBuf = "3349acd9-ac6a-5e09-bcdb-63829b23a429"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[compat]
ColorTypes = "0.7, 0.8, 0.9, 0.10"
FileIO = "1"
FixedPointNumbers = "0.6, 0.7, 0.8"
ImageCore = "0.7, 0.8"
ProtoBuf = "0.7, 0.8"
Requires = "0.5, 1"
StatsBase = "0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33"
julia = "0.7, 1"

[extras]
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1"
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
QuartzImageIO = "dca85d43-d64c-5e67-8c65-017450d5d020"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990"
ValueHistories = "98cad3c8-aec3-5f06-8e41-884608649ab7"
WAV = "8149f6b0-98f6-5db9-b78f-408fbbb8ef88"

[targets]
test = ["Test", "TestImages", "ImageMagick", "Logging", "LightGraphs", "Plots", "WAV", "ValueHistories", "QuartzImageIO"]
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
TensorBoardLogger = "899adc3e-224a-11e9-021f-63837185c80f"
82 changes: 43 additions & 39 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using TensorBoardLogger, Logging
using TensorBoardLogger: preprocess, summary_impl
using Test
using MLDatasets
using TestImages
using ImageCore
using ColorTypes
Expand Down Expand Up @@ -139,43 +138,46 @@ end
@test π != log_image(logger, "rand/CLN", rand(3, 10, 2), CLN, step = step)
@test π != log_image(logger, "rand/LCN", rand(10, 3, 2), LCN, step = step)

sample = MNIST.traintensor(1:3)
@test π != log_image(logger, "mnist/HWN", sample, HWN, step = step)
@test π != log_image(logger, "mnist2/HWN", Gray.(sample), step = step)
sample = permutedims(sample, (2, 1, 3))
@test π != log_image(logger, "mnist/WHN", sample, WHN, step = step)
@test π != log_image(logger, "mnist2/WHN", Gray.(sample), WHN, step = step)
sample = permutedims(sample, (3, 2, 1))
@test π != log_image(logger, "mnist/NHW", sample, NHW, step = step)
@test π != log_image(logger, "mnist2/NHW", Gray.(sample), NHW, step = step)
sample = permutedims(sample, (1, 3, 2))
@test π != log_image(logger, "mnist/NWH", sample, NWH, step = step)
@test π != log_image(logger, "mnist2/NWH", Gray.(sample), NWH, step = step)
sample = testimage("toucan")
@test π != log_image(logger, "toucan/auto", sample, step = step)
sample = [sample, sample, sample]
@test π != log_images(logger, "toucans/auto", sample, step = step)
@test π != log_images(logger, "toucans", sample, CHW, step = step)

sample = hcat(sample...)
sample = reshape(sample, (150, 162, 3))
@test π != log_image(logger, "toucan/CHWN", sample, CHWN, step = step)
sample = permutedims(sample, (2, 1, 3))
@test π != log_image(logger, "toucan/CWHN", sample, CWHN, step = step)
sample = channelview(sample) #CWHN
sample = permutedims(sample, (4, 1, 2, 3))
@test π != log_image(logger, "toucan/NCWH", sample, NCWH, step = step)
sample = permutedims(sample, (1, 2, 4, 3))
@test π != log_image(logger, "toucan/NCHW", sample, NCHW, step = step)
sample = permutedims(sample, (1, 4, 3, 2))
@test π != log_image(logger, "toucan/NWHC", sample, NWHC, step = step)
sample = permutedims(sample, (1, 3, 2, 4))
@test π != log_image(logger, "toucan/NHWC", sample, NHWC, step = step)
sample = permutedims(sample, (2, 3, 4, 1))
@test π != log_image(logger, "toucan/HWCN", sample, HWCN, step = step)
sample = permutedims(sample, (2, 1, 3, 4))
@test π != log_image(logger, "toucan/WHCN", sample, WHCN, step = step)

if VERSION >= v"1.3.0"
using MLDatasets: MNIST

sample = MNIST.traintensor(1:3)
@test π != log_image(logger, "mnist/HWN", sample, HWN, step = step)
@test π != log_image(logger, "mnist2/HWN", Gray.(sample), step = step)
sample = permutedims(sample, (2, 1, 3))
@test π != log_image(logger, "mnist/WHN", sample, WHN, step = step)
@test π != log_image(logger, "mnist2/WHN", Gray.(sample), WHN, step = step)
sample = permutedims(sample, (3, 2, 1))
@test π != log_image(logger, "mnist/NHW", sample, NHW, step = step)
@test π != log_image(logger, "mnist2/NHW", Gray.(sample), NHW, step = step)
sample = permutedims(sample, (1, 3, 2))
@test π != log_image(logger, "mnist/NWH", sample, NWH, step = step)
@test π != log_image(logger, "mnist2/NWH", Gray.(sample), NWH, step = step)
sample = testimage("toucan")
@test π != log_image(logger, "toucan/auto", sample, step = step)
sample = [sample, sample, sample]
@test π != log_images(logger, "toucans/auto", sample, step = step)
@test π != log_images(logger, "toucans", sample, CHW, step = step)

sample = hcat(sample...)
sample = reshape(sample, (150, 162, 3))
@test π != log_image(logger, "toucan/CHWN", sample, CHWN, step = step)
sample = permutedims(sample, (2, 1, 3))
@test π != log_image(logger, "toucan/CWHN", sample, CWHN, step = step)
sample = channelview(sample) #CWHN
sample = permutedims(sample, (4, 1, 2, 3))
@test π != log_image(logger, "toucan/NCWH", sample, NCWH, step = step)
sample = permutedims(sample, (1, 2, 4, 3))
@test π != log_image(logger, "toucan/NCHW", sample, NCHW, step = step)
sample = permutedims(sample, (1, 4, 3, 2))
@test π != log_image(logger, "toucan/NWHC", sample, NWHC, step = step)
sample = permutedims(sample, (1, 3, 2, 4))
@test π != log_image(logger, "toucan/NHWC", sample, NHWC, step = step)
sample = permutedims(sample, (2, 3, 4, 1))
@test π != log_image(logger, "toucan/HWCN", sample, HWCN, step = step)
sample = permutedims(sample, (2, 1, 3, 4))
@test π != log_image(logger, "toucan/WHCN", sample, WHCN, step = step)
end
end

@testset "Image processing interface" begin
Expand Down Expand Up @@ -274,7 +276,9 @@ end
include("Optional/test_Plots.jl")
# Don't run PyPlot tests until I figure a way to install the dependencies
#include("Optional/test_PyPlot.jl")
include("Optional/test_Tracker.jl")
if VERSION >= v"1.5.0"
include("Optional/test_Tracker.jl")
end
end

@testset "Logger dispatch overrides" begin
Expand Down

2 comments on commit 07fa2a7

@PhilipVinc
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/24814

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.12 -m "<description of version>" 07fa2a75efbafbed9c1cfbf0e297499474111b28
git push origin v0.1.12

Please sign in to comment.