Skip to content

Update GitHub actions and add coverage #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 3, 2023
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
52 changes: 14 additions & 38 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,48 @@
name: julia 1.6
name: julia
on:
push:
branches:
- master
pull_request:

jobs:
testMKLjl:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
name: ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- "1.6"
- "1.8"
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- name: Cache artifacts
uses: actions/cache@v1
uses: actions/cache@v2
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
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@latest
- uses: julia-actions/julia-runtest@latest

# testAptMKL:
# name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# version:
# - '1.0'
# - '1.3'
# os:
# - ubuntu-latest
# arch:
# - x64
# env:
# LD_LIBRARY_PATH: /opt/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64_lin/
# steps:
# - name: Install MKL via apt
# run: |
# curl https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB > GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
# sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
# rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
# sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
# sudo apt-get update
# sudo apt-get install -y intel-mkl-64bit-2019.4-070
# - uses: actions/checkout@v2
# - uses: julia-actions/setup-julia@latest
# with:
# version: ${{ matrix.version }}
# arch: ${{ matrix.arch }}
# - uses: julia-actions/julia-buildpkg@latest
# - uses: julia-actions/julia-runtest@latest
- uses: julia-actions/julia-processcoverage@v1
- if: matrix.version == '1.8' && matrix.os == 'ubuntu-latest'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info
14 changes: 7 additions & 7 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ on:
- master
pull_request:
schedule:
- cron: '1 0 1,15 * *'
- cron: "1 0 1,15 * *"

jobs:
testMKLjl:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
name: ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- 'nightly'
- "nightly"
os:
- ubuntu-latest
- macOS-latest
Expand All @@ -33,7 +33,7 @@ jobs:
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
Expand All @@ -53,7 +53,7 @@ jobs:
# - ubuntu-latest
# arch:
# - x64
# env:
# env:
# LD_LIBRARY_PATH: /opt/intel/compilers_and_libraries_2019.4.243/linux/mkl/lib/intel64_lin/
# steps:
# - name: Install MKL via apt
Expand All @@ -71,4 +71,4 @@ jobs:
# version: ${{ matrix.version }}
# arch: ${{ matrix.arch }}
# - uses: julia-actions/julia-buildpkg@latest
# - uses: julia-actions/julia-runtest@latest
# - uses: julia-actions/julia-runtest@latest
101 changes: 0 additions & 101 deletions test/Manifest.toml

This file was deleted.

2 changes: 1 addition & 1 deletion test/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@ function randindomain(t::Type{T}, n, domain) where {T<:Complex}
d2 = convert(t, domain[2])
ddiff = d2 - d1
@assert isfinite(ddiff)
return rand(t, 2*n) .* ddiff .+ d1
return rand(t, 2 * n) .* ddiff .+ d1
end
55 changes: 30 additions & 25 deletions test/complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
const NVALS_complex = 1000

const input_complex = Dict(
t=>[ (randindomain(t, NVALS_complex, domain),) for (_, _, domain) in base_unary_complex ]
for t in (ComplexF32, ComplexF64)
t => [(randindomain(t, NVALS_complex, domain),) for (_, _, domain) in base_unary_complex]
for t in (ComplexF32, ComplexF64)
)

const fns_complex = [x[1:2] for x in base_unary_complex]
Expand All @@ -14,30 +14,35 @@ const fns_complex = [x[1:2] for x in base_unary_complex]
# )

@testset "Definitions and Comparison with Base for Complex" begin
for t in (ComplexF32, ComplexF64), i = 1:length(fns_complex)
inp = input_complex[t][i]
mod, fn = fns_complex[i]
base_fn = getproperty(mod, fn)
vml_fn = getproperty(IntelVectorMath, fn)
vml_fn! = getproperty(IntelVectorMath, Symbol(fn, "!"))

Test.@test parentmodule(vml_fn) == IntelVectorMath

# Test.test_approx_eq(output[t][i], fn(input[t][i]...), "Base $t $fn", "IntelVectorMath $t $fn")
baseres = base_fn.(inp...)
Test.@test vml_fn(inp...) ≈ base_fn.(inp...)

if inp == 1
if fn != :abs && fn != :angle
vml_fn!(inp[1])
Test.@test inp[1] ≈ baseres
for t in (ComplexF32, ComplexF64)
@testset "Type: $t" begin
for i = 1:length(fns_complex)
inp = input_complex[t][i]
mod, fn = fns_complex[i]
base_fn = getproperty(mod, fn)
vml_fn = getproperty(IntelVectorMath, fn)
vml_fn! = getproperty(IntelVectorMath, Symbol(fn, "!"))

@testset "$fn" begin

Test.@test parentmodule(vml_fn) == IntelVectorMath

# Test.test_approx_eq(output[t][i], fn(input[t][i]...), "Base $t $fn", "IntelVectorMath $t $fn")
baseres = base_fn.(inp...)
Test.@test vml_fn(inp...) ≈ base_fn.(inp...)

if inp == 1
if fn != :abs && fn != :angle
vml_fn!(inp[1])
Test.@test inp[1] ≈ baseres
end
elseif length(inp) == 2
out = similar(inp[1])
vml_fn!(out, inp...)
Test.@test out ≈ baseres
end
end
end
elseif length(inp) == 2
out = similar(inp[1])
vml_fn!(out, inp...)
Test.@test out ≈ baseres
end

end

end
Loading