This repository was archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
82 lines (69 loc) · 2.2 KB
/
OS-UnitTests.yml
File metadata and controls
82 lines (69 loc) · 2.2 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: OS Unit Tests
on:
push:
branches:
- staging
- trying
jobs:
test-os:
timeout-minutes: 210
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
# Workaround for OSX MPICH issue:
# https://github.com/pmodels/mpich/issues/4710
env:
MPICH_INTERFACE_HOSTNAME: "localhost"
CLIMATEMACHINE_TEST_RUNMPI_LOCALHOST: "true"
CLIMATEMACHINE_SETTINGS_FIX_RNG_SEED: "true"
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.0
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2.2.0
# Setup a filter and only run if src/ test/ folder content changes
# or project depedencies
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
run_test:
- 'src/**'
- 'test/**'
- 'Project.toml'
- 'Manifest.toml'
- name: Set up Julia
uses: julia-actions/setup-julia@latest
if: steps.filter.outputs.run_test == 'true'
with:
version: 1.5.4
# https://discourse.julialang.org/t/recommendation-cache-julia-artifacts-in-ci-services/35484
- name: Cache artifacts
uses: actions/cache@v1
if: steps.filter.outputs.run_test == 'true'
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 }}-
- name: Install Project Packages
if: steps.filter.outputs.run_test == 'true'
run: |
julia --project=@. -e 'using Pkg; Pkg.instantiate()'
- name: Build System Image
if: steps.filter.outputs.run_test == 'true'
continue-on-error: true
run: |
julia --project .dev/systemimage/climate_machine_image.jl ClimateMachine.so true
- name: Run Unit Tests
if: steps.filter.outputs.run_test == 'true'
run: |
julia --project -J ClimateMachine.so -e 'using Pkg; Pkg.test()'