Skip to content
Open
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
6 changes: 5 additions & 1 deletion .github/workflows/UnitTest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Unit test
name: OffsetArrays Unit Tests

on:
push:
Expand All @@ -10,11 +10,15 @@ on:
- 'LICENSE.md'
- 'README.md'
- '.github/workflows/TagBot.yml'
- '.github/workflows/UnitTest_core.yml'
- 'OffsetArraysCore/**'
pull_request:
paths-ignore:
- 'LICENSE.md'
- 'README.md'
- '.github/workflows/TagBot.yml'
- '.github/workflows/UnitTest_core.yml'
- 'OffsetArraysCore/**'
schedule:
- cron: '20 00 1 * *'

Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/UnitTest_core.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: OffsetArraysCore Unit Tests

on:
push:
tags:
- 'v*'
branches:
- master
paths:
- 'OffsetArraysCore/**'
- '.github/workflows/UnitTest_core.yml'
pull_request:
paths:
- 'OffsetArraysCore/**'
- '.github/workflows/UnitTest_core.yml'

concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
# allow-failure is not supported yet
# https://github.com/actions/toolkit/issues/399
fail-fast: false
matrix:
julia-version: ['min', 'lts', '1', 'pre']
os: [ubuntu-latest, windows-latest, macOS-latest]
# only test one 32-bit job
include:
- os: ubuntu-latest
julia-version: '1'
julia-arch: x86

steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
- uses: julia-actions/cache@v2
- name: Test OffsetArraysCore subpackage
run: julia --project=OffsetArraysCore -e 'using Pkg; Pkg.test(coverage=true)'
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
5 changes: 4 additions & 1 deletion .github/workflows/invalidations.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Invalidations
on: pull_request
on:
pull_request:
paths:
- 'src/**'

jobs:
evaluate:
Expand Down
41 changes: 41 additions & 0 deletions OffsetArraysCore/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name = "OffsetArraysCore"
uuid = "8bef33ee-3d68-4d38-b478-812fb774fb26"
version = "1.0.0"
authors = ["Jishnu Bhattacharya <jishnub.github@gmail.com>"]

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

[weakdeps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

[extensions]
OffsetArraysAdaptExt = "Adapt"

[compat]
Adapt = "2, 3, 4"
Aqua = "0.8"
CatIndices = "0.2"
DelimitedFiles = "<0.0.1, 1"
Documenter = "0.27, 1"
EllipsisNotation = "1"
FillArrays = "0.11, 0.13, 1"
LinearAlgebra = "<0.0.1, 1"
StaticArrays = "1"
Test = "<0.0.1, 1"
julia = "0.7, 1"

[extras]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
CatIndices = "aafaddc9-749c-510e-ac4f-586e18779b91"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
EllipsisNotation = "da5c29d0-fa7d-589e-88eb-ea29b0a81949"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Adapt", "Aqua", "CatIndices", "DelimitedFiles", "Documenter", "EllipsisNotation", "FillArrays", "LinearAlgebra", "StaticArrays", "Test"]
17 changes: 17 additions & 0 deletions OffsetArraysCore/ext/OffsetArraysAdaptExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module OffsetArraysAdaptExt

using OffsetArraysCore, Adapt

##
# Adapt allows for automatic conversion of CPU OffsetArrays to GPU OffsetArrays
##
import Adapt
Adapt.adapt_structure(to, O::OffsetArray) = OffsetArraysCore.parent_call(x -> Adapt.adapt(to, x), O)

@static if isdefined(Adapt, :parent_type)
# To support Adapt 3.0 which doesn't have parent_type defined
Adapt.parent_type(::Type{OffsetArray{T,N,AA}}) where {T,N,AA} = AA
Adapt.unwrap_type(W::Type{<:OffsetArray}) = unwrap_type(parent_type(W))
end

end
Loading
Loading