-
-
Notifications
You must be signed in to change notification settings - Fork 74
57 lines (45 loc) · 1.73 KB
/
UnitTests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Unit Tests
on:
pull_request:
push:
branches:
- master
jobs:
test-slurm:
timeout-minutes: 20
strategy:
matrix:
os: [ubuntu-latest]
julia_version: ["1.5", "nightly"]
julia_arch: [x64]
fail-fast: false
runs-on: ${{ matrix.os }}
env:
SLURM: "latest"
steps:
- name: Checkout
uses: actions/[email protected]
- uses: julia-actions/setup-julia@latest
with:
arch: ${{ matrix.julia_arch }}
version: ${{ matrix.julia_version }}
- name: Start Slurm Docker image
run: |
docker pull giovtorres/docker-centos7-slurm:$SLURM
docker run -d -it -h ernie -v $(pwd):/SlurmTools -v $(julia -e 'print(dirname(Sys.BINDIR))'):/julia --name slurm-$SLURM giovtorres/docker-centos7-slurm:$SLURM
- name: Instantiate package
run: docker exec slurm-$SLURM /julia/bin/julia --project=/SlurmTools -e 'using Pkg; Pkg.instantiate(verbose=true); Pkg.build(verbose=true)'
- name: Run tests without allocation
run: docker exec slurm-$SLURM /julia/bin/julia --project=/SlurmTools -e 'using Pkg; Pkg.test(test_args=["slurm"])'
- name: Run tests inside allocation
run: docker exec slurm-$SLURM salloc -t 00:10:00 -n 2 /julia/bin/julia --project=/SlurmTools -e 'using Pkg; Pkg.test(test_args=["slurm"])'
- name: Run tests inside sbatch
run: |
cat << EOF > sbatch.sh
#!/bin/bash
#SBATCH --ntasks=2
#SBATCH --time=00:10:00
/julia/bin/julia --project=/SlurmTools -e 'using Pkg; Pkg.test(test_args=["slurm"])'
EOF
docker exec slurm-$SLURM sbatch --wait --output=/SlurmTools/output --error=/SlurmTools/output /SlurmTools/sbatch.sh
cat output