-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (99 loc) · 4.03 KB
/
main.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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Main CI
on: [push, pull_request]
jobs:
gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++ make cmake libboost-all-dev
- name: Create ./cmake-build directory
run: mkdir ./cmake-build
- name: Build and install
run: |
cmake $GITHUB_WORKSPACE
make -j2 VERBOSE=1
sudo make VERBOSE=1 install
working-directory: ./cmake-build
- name: Run freddi
run: ./freddi --fulldata --starflux
working-directory: ./cmake-build
- name: Run freddi-ns
run: ./freddi-ns --Mx=1.4 --alpha=0.25 --Mopt=0.5 period=1 --Mdot0=1e17 --initialcond=quasistat --Bx=1e8 --fulldata --starflux
working-directory: ./cmake-build
- name: Unit tests
run: ctest -V
working-directory: ./cmake-build
- name: Regression test
run: FREDDI=../../../cmake-build/freddi ./generate_test_data.sh && git diff --word-diff --exit-code
working-directory: ./python/test/data
- name: Check --help messages in Readme.md
run: FREDDI_PREFIX=./cmake-build/ ./.ci/update-help-readme.py && git diff --word-diff --exit-code
clang:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang make cmake libboost-all-dev
- name: Create ./cmake-build directory
run: mkdir ./cmake-build
- name: Build and install
run: |
cmake -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ ..
make -j2 VERBOSE=1
sudo make VERBOSE=1 install
working-directory: ./cmake-build
- name: Run freddi
run: ./freddi --fulldata --starflux
working-directory: ./cmake-build
- name: Run freddi-ns
run: ./freddi-ns --Mx=1.4 --alpha=0.25 --Mopt=0.5 period=1 --Mdot0=1e17 --initialcond=quasistat --Bx=1e8 --fulldata --starflux
working-directory: ./cmake-build
- name: Unit tests
run: ctest -V
working-directory: ./cmake-build
- name: Regression test
run: FREDDI=../../../cmake-build/freddi ./generate_test_data.sh && git diff --word-diff --exit-code
working-directory: ./python/test/data
- name: Check --help messages in Readme.md
run: FREDDI_PREFIX=./cmake-build/ ./.ci/update-help-readme.py && git diff --word-diff --exit-code
cpython:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++ make cmake libboost-all-dev python3-dev python3-numpy python3-pip libboost-python-dev libboost-numpy-dev
- name: Install Python dependencies
run: |
python3 -m pip install -U pip setuptools
python3 -m pip install parameterized pytest numpy scipy
- name: Install
run: python3 -m pip install .
- name: Test
run: python3 -m pytest
docker-exe:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build container
run: docker build -t freddi .
- name: Run freddi
run: docker run --rm -t freddi freddi --fulldata --starflux
- name: Run freddi-ns
run: docker run --rm -t freddi freddi-ns --Bx=1e16 --fulldata --starflux
docker-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build container with wheels
run: docker build -f Dockerfile.python -t freddi:python .
- name: Build containers
run: for V in 3.7 3.8 3.9 3.10 3.11 3.12; do docker build -f .ci/Dockerfile-test-wheels --build-arg PY_VERSION=$V -t freddi:python$V .; done
- name: Run sample Python script
run: for V in 3.7 3.8 3.9 3.10 3.11 3.12 ; do docker run --rm -t freddi:python$V python -c "import freddi; freddi.Freddi(**freddi._freddi._Freddi._required_args())"; done