Skip to content

Commit

Permalink
Switch CI to Github actions (#57)
Browse files Browse the repository at this point in the history
* Switch CI to Github actions

* Fix tests on 32-bit

* More fixes for 32-bit
  • Loading branch information
odow authored Nov 12, 2020
1 parent 195796c commit c27d53c
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 39 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI
on:
push:
branches: [master]
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# MutableArithmetics doesn't have any binary dependencies, so just test
# on Linux, LTS and current release, 64-bit and 32-bit.
include:
- version: '1.0'
os: ubuntu-latest
arch: x86
- version: '1.0'
os: ubuntu-latest
arch: x64
- version: '1'
os: ubuntu-latest
arch: x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- 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 }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
23 changes: 23 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Documentation
on:
push:
branches: [master]
tags: '*'
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
# Build documentation on Julia 1.0
version: '1.0'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
run: julia --project=docs/ docs/make.jl
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

22 changes: 13 additions & 9 deletions test/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ end

@testset "Errors" begin
@testset "`promote_op` error" begin
AT = CustomArray{Int, 3}
AT = CustomArray{Int64, 3}
err = ErrorException("`promote_operation(+, CustomArray{Int64,3}, CustomArray{Int64,3})` not implemented yet, please report this.")
@test_throws err MA.promote_operation(+, AT, AT)
end
Expand Down Expand Up @@ -104,10 +104,12 @@ end

# 40 bytes to create the buffer
# 8 bytes in the double for loop. FIXME: figure out why
alloc_test(() -> MA.add_mul!(y, A, x), 48)
alloc_test(() -> MA.operate_fallback!(MA.IsMutable(), MA.add_mul, y, A, x), 48)
alloc_test(() -> MA.operate!(MA.add_mul, y, A, x), 48)
alloc_test(() -> MA.mutable_operate!(MA.add_mul, y, A, x), 48)
# Half size on 32-bit.
n = Sys.WORD_SIZE == 64 ? 48 : 24
alloc_test(() -> MA.add_mul!(y, A, x), n)
alloc_test(() -> MA.operate_fallback!(MA.IsMutable(), MA.add_mul, y, A, x), n)
alloc_test(() -> MA.operate!(MA.add_mul, y, A, x), n)
alloc_test(() -> MA.mutable_operate!(MA.add_mul, y, A, x), n)
end
@testset "matrix-matrix product" begin
A = [1 2 3; 4 5 6; 6 8 9]
Expand Down Expand Up @@ -140,11 +142,13 @@ end
alloc_test(() -> MA.mutability(C, MA.add_mul, C, A, B), 0)
end

# 40 bytes to create the buffer
# 40 bytes to create the buffer on 64-bit.
# 8 bytes in the double for loop. FIXME: figure out why
alloc_test(() -> MA.add_mul!(C, A, B), 48)
alloc_test(() -> MA.operate!(MA.add_mul, C, A, B), 48)
alloc_test(() -> MA.mutable_operate!(MA.add_mul, C, A, B), 48)
# Half size on 32-bit.
n = Sys.WORD_SIZE == 64 ? 48 : 24
alloc_test(() -> MA.add_mul!(C, A, B), n)
alloc_test(() -> MA.operate!(MA.add_mul, C, A, B), n)
alloc_test(() -> MA.mutable_operate!(MA.add_mul, C, A, B), n)
end
end

Expand Down

0 comments on commit c27d53c

Please sign in to comment.