Skip to content

Commit 2bbdcf9

Browse files
authored
add github actions CI (#408)
Useful to track #407.
1 parent 49d18e8 commit 2bbdcf9

File tree

2 files changed

+64
-2
lines changed

2 files changed

+64
-2
lines changed

.github/workflows/UnitTests.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request:
5+
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
test-os:
12+
timeout-minutes: 120
13+
strategy:
14+
matrix:
15+
include:
16+
- os: ubuntu-latest
17+
- os: windows-latest
18+
- os: macos-latest
19+
mpiexec_args: "-host localhost"
20+
21+
fail-fast: false
22+
23+
runs-on: ${{ matrix.os }}
24+
env:
25+
MPICH_INTERFACE_HOSTNAME: localhost
26+
JULIA_MPIEXEC_ARGS: ${{ matrix.mpiexec_args }}
27+
28+
steps:
29+
- name: Cancel Previous Runs
30+
uses: styfle/cancel-workflow-action@0.4.0
31+
with:
32+
access_token: ${{ github.token }}
33+
34+
- name: Checkout
35+
uses: actions/checkout@v2.2.0
36+
37+
- name: Set up Julia
38+
uses: julia-actions/setup-julia@v1.1.6
39+
with:
40+
version: 1.4
41+
42+
# https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484
43+
- name: Cache artifacts
44+
uses: actions/cache@v1
45+
env:
46+
cache-name: cache-artifacts
47+
with:
48+
path: ~/.julia/artifacts
49+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
50+
restore-keys: |
51+
${{ runner.os }}-test-${{ env.cache-name }}-
52+
${{ runner.os }}-test-
53+
${{ runner.os }}-
54+
55+
- name: Install Project Packages
56+
run: |
57+
julia --project=@. -e 'using Pkg; Pkg.instantiate(); Pkg.build(verbose=true)'
58+
59+
- name: Run Unit Tests
60+
run: |
61+
julia --project=@. -e 'using Pkg; Pkg.test()'

test/mpiexecjl.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ using MPI
66
# Install MPI locally, so that we can test the `--project` flag to
77
# `mpiexecjl`
88
Pkg.activate(dir)
9-
Pkg.add("MPI")
9+
Pkg.develop(PackageSpec(path=joinpath(@__DIR__, "..")))
1010
# Test installation
1111
@test_logs (:info, r"Installing") (:info, r"Done") MPI.install_mpiexecjl(; destdir = dir)
1212
# Test a run of mpiexec
1313
mpiexecjl = joinpath(dir, "mpiexecjl")
1414
julia = joinpath(Sys.BINDIR, Base.julia_exename())
1515
example = joinpath(@__DIR__, "..", "docs", "examples", "01-hello.jl")
16-
@test success(`$(mpiexecjl) --project=$(dir) $(julia) --startup-file=no -q $(example)`)
16+
p = run(`$(mpiexecjl) --project=$(dir) $(julia) --startup-file=no -q $(example)`)
17+
@test success(p)
1718
# Test help messages
1819
for help_flag in ("-h", "--help")
1920
help_message = read(`$(mpiexecjl) --project=$(dir) --help`, String)

0 commit comments

Comments
 (0)