Skip to content

Commit

Permalink
Merge pull request #4 from CFDML/ci
Browse files Browse the repository at this point in the history
Add github actions
  • Loading branch information
vavrines authored Jul 1, 2024
2 parents 9a2e27c + 95c9e22 commit 795afa4
Show file tree
Hide file tree
Showing 9 changed files with 225 additions and 91 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
fail-fast: false
matrix:
version:
- '1.10'
# - 'nightly'
os:
- ubuntu-latest
# - macOS-latest
# - windows-latest
arch:
- x64
steps:
- run: |
pip3 install meshio scipy --user
- 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@latest
- run: |
git config --global user.name Tester
git config --global user.email [email protected]
- uses: julia-actions/julia-runtest@latest
continue-on-error: ${{ matrix.version == 'nightly' }}
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
16 changes: 16 additions & 0 deletions .github/workflows/compat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CompatHelper

on:
schedule:
- cron: '00 00 * * *'

jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
31 changes: 31 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: FormatPR
on:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/cache@v1
- name: Install JuliaFormatter and format
run: |
julia -e 'import Pkg; Pkg.add("JuliaFormatter")'
julia -e 'using JuliaFormatter; format(".")'
# https://github.com/marketplace/actions/create-pull-request
# https://github.com/peter-evans/create-pull-request#reference-example
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Format .jl files
title: 'Automatic JuliaFormatter.jl run'
branch: auto-juliaformatter-pr
delete-branch: true
labels: formatting, automated pr, no changelog
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
12 changes: 12 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: TagBot
on:
schedule:
- cron: 0 0 * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
4 changes: 2 additions & 2 deletions lib/P4estTypes/src/connectivity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ end
| | /
| |/
1--------3
"""
function Connectivity{X}(vertices::AbstractVector, cells::AbstractVector) where {X}
if X == 4
Expand Down Expand Up @@ -292,7 +291,8 @@ function Base.:(==)(x::Connectivity{8}, y::Connectivity{8})
p8est_connectivity_is_equivalent(x.pointer, y.pointer) == 1
end

Base.isvalid(c::Connectivity{4}) = GC.@preserve c p4est_connectivity_is_valid(c.pointer) == 1
Base.isvalid(c::Connectivity{4}) =
GC.@preserve c p4est_connectivity_is_valid(c.pointer) == 1
Base.sizeof(c::Connectivity{4}) = Int(p4est_connectivity_memory_used(c.pointer))

Base.isvalid(c::Connectivity{8}) = p8est_connectivity_is_valid(c.pointer) == 1
Expand Down
21 changes: 14 additions & 7 deletions lib/P4estTypes/src/ghost.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,14 @@ Construct a ghost layer of quadrants that neighbor the local to the rank
for the given `forest`. Here `connection` determines what neighboring
quadrants to include (across face, edge, corner, or full) and can take the
values:
- `P4estTypes.CONNECT_FULL(Val(4))`: get face and corner neighbors.
- `P4estTypes.CONNECT_FULL(Val(8))`: get face, edge, and corner neighbors.
- `P4estTypes.CONNECT_FACE(Val(4))`: get face neighbors.
- `P4estTypes.CONNECT_FACE(Val(8))`: get face neighbors.
- `P4estTypes.CONNECT_EDGE(Val(8))`: get face and edge neighbors.
- `P4estTypes.CONNECT_CORNER(Val(4))`: get face and corner neighbors.
- `P4estTypes.CONNECT_CORNER(Val(8)): `get face, edge, and corner neighbors.
- `P4estTypes.CONNECT_FULL(Val(4))`: get face and corner neighbors.
- `P4estTypes.CONNECT_FULL(Val(8))`: get face, edge, and corner neighbors.
- `P4estTypes.CONNECT_FACE(Val(4))`: get face neighbors.
- `P4estTypes.CONNECT_FACE(Val(8))`: get face neighbors.
- `P4estTypes.CONNECT_EDGE(Val(8))`: get face and edge neighbors.
- `P4estTypes.CONNECT_CORNER(Val(4))`: get face and corner neighbors.
- `P4estTypes.CONNECT_CORNER(Val(8)): `get face, edge, and corner neighbors.
"""
function ghostlayer(forest::Pxest{X}; connection = CONNECT_FULL(Val(X))) where {X}
return GhostLayer{X}((pxest_ghost_new(Val(X)))(forest, connection))
Expand Down Expand Up @@ -160,6 +161,7 @@ end
Returns 0-based indices into `mirror_proc_mirrors` for each rank. This includes
an extra entry at the end of the array so that 1-based range into
`mirror_proc_mirrors` for rank `r` can be built with
```
(mirror_proc_offsets[r]+1):mirror_proc_offsets[r+1]
```
Expand All @@ -184,10 +186,13 @@ end
Returns 0-based indices into [`ghosts`](@ref) for each rank. This includes
an extra entry at the end of the array so that 1-based range into
[`ghosts`](@ref) for rank `r` can be built with
```
(proc_offsets[r]+1):proc_offsets[r+1]
```
Thus the ghost quadrants associated with rank `r` can be obtained with
```
ghosts(ghost)[(proc_offsets[r]+1):proc_offsets[r+1]]
```
Expand All @@ -212,10 +217,12 @@ end
Returns 0-based indices into [`mirrors`](@ref). This is used in conjunction
with `mirror_proc_offsets` to get the mirror quadrants associated with
each rank. For example
```
rrange = (mirror_proc_offsets[r]+1):mirror_proc_offsets[r+1]
mirrors(ghost)[mirror_proc_mirrors(rrange)]
```
selects the mirror quadrants associated with rank `r`.
See `@doc P4estTypes.P4est.p4est_ghost_t` and
Expand Down
Loading

0 comments on commit 795afa4

Please sign in to comment.