-
Notifications
You must be signed in to change notification settings - Fork 3
233 lines (205 loc) · 7.21 KB
/
CI.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
name: CI
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
env:
LFORTRAN_VERSION: 0.33.0
MACOSX_DEPLOYMENT_TARGET: 12.0
jobs:
Build:
name: Conda-Forge LFortran Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["windows-2019", "macos-latest", "ubuntu-latest"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
create-args: >-
lfortran=${{ env.LFORTRAN_VERSION }}
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}
- name: Print installed packages information
shell: bash -e -x -l {0}
run: |
which lfortran
micromamba env list
micromamba activate lf
micromamba list
which lfortran
- name: Clone LFortran Source Repository
shell: bash -e -x -l {0}
run: |
git clone https://github.com/lfortran/lfortran.git
cd lfortran
git fetch https://github.com/lfortran/lfortran.git --tags -f
git checkout v${{ env.LFORTRAN_VERSION }}
- name: Run LFortran Integration Tests
if: ${{ !startsWith(matrix.os, 'windows-2019') }}
shell: bash -e -x -l {0}
run: |
cd lfortran/integration_tests
./run_tests.py -b llvm wasm
- name: Run LFortran Fast Integration Tests
if: ${{ !startsWith(matrix.os, 'windows-2019') }}
shell: bash -e -x -l {0}
run: |
cd lfortran/integration_tests
./run_tests.py -b llvm wasm -f
- name: Run LFortran Reference Tests
if: ${{ !startsWith(matrix.os, 'windows-2019') }}
shell: bash -e -x -l {0}
run: |
cd lfortran
./run_tests.py --skip-run-with-dbg --no-llvm --skip-cpptranslate
third_party_code_compile:
name: Check Third Party Code Compilation ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["macos-latest", "ubuntu-latest"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
create-args: >-
lfortran=${{ env.LFORTRAN_VERSION }}
python=3.10
openblas=0.3.21
llvm-openmp=14.0.4
- name: Print installed packages information
shell: bash -e -x -l {0}
run: |
which lfortran
micromamba env list
micromamba activate lf
micromamba list
which lfortran
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-ubuntu-latest
- name: Test Modern Minpack (Fortran-Lang)
shell: bash -e -x -l {0}
run: |
git clone https://github.com/fortran-lang/minpack modern_minpack_01
cd modern_minpack_01
git checkout c0b5aea9fcd2b83865af921a7a7e881904f8d3c2
lfortran ./src/minpack.f90 -c --legacy-array-sections
lfortran ./examples/example_hybrd.f90 --legacy-array-sections
lfortran ./examples/example_hybrd1.f90 --legacy-array-sections
lfortran ./examples/example_lmdif1.f90 --legacy-array-sections
lfortran ./examples/example_lmder1.f90 --legacy-array-sections
- name: Test dftatom
shell: bash -e -x -l {0}
run: |
git clone https://github.com/certik/dftatom.git
cd dftatom
git checkout b838e858e046a36dd2235713ba111199bcf718bd
make -f Makefile.manual F90=lfortran F90FLAGS="-I../../src"
make -f Makefile.manual test
git clean -dfx
make -f Makefile.manual F90="lfortran --skip-pass=inline_function_calls,fma --fast" F90FLAGS="-I../../src"
make -f Makefile.manual test
- name: Test fastGPT
shell: bash -e -x -l {0}
run: |
git clone https://github.com/certik/fastGPT.git
cd fastGPT
git clean -dfx
git checkout -t origin/namelist
git checkout d3eef520c1be8e2db98a3c2189740af1ae7c3e06
curl -o model.dat -L https://huggingface.co/datasets/certik/fastGPT/resolve/main/model_fastgpt_124M_v1.dat
mkdir lf
cd lf
FC=lfortran CMAKE_PREFIX_PATH=$CONDA_PREFIX cmake -DFASTGPT_BLAS=OpenBLAS -DCMAKE_BUILD_TYPE=Debug ..
make VERBOSE=1
ln -s ../model.dat .
./gpt2
./test_basic_input
./test_more_inputs
cd ..
mkdir lf-fast
cd lf-fast
FC="lfortran --fast" CMAKE_PREFIX_PATH=$CONDA_PREFIX cmake -DFASTGPT_BLAS=OpenBLAS -DCMAKE_BUILD_TYPE=Release ..
make VERBOSE=1
ln -s ../model.dat .
./gpt2
./test_basic_input
./test_more_inputs
cd ..
test_scipy:
name: Check SciPy Build and Test Run ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"] # test only on ubuntu for now
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: mamba-org/setup-micromamba@v1
- uses: hendrikmuhs/ccache-action@main
with:
variant: sccache
key: ${{ github.job }}-ubuntu-latest
- name: Build SciPy
shell: bash -e -x -l {0}
run: |
git clone https://github.com/scipy/scipy
cd scipy
git remote add ondrej https://github.com/certik/scipy
git fetch ondrej
git checkout -t ondrej/merge_special_minpack_fitpack_02
git checkout a32e743e53550533d44a8f7c44a71132eca750bf
micromamba env create -f environment.yml
micromamba activate scipy-dev
micromamba install -c conda-forge lfortran=${{ env.LFORTRAN_VERSION }}
git submodule update --init
mkdir lfortran-build/
cd lfortran-build/
LIBRARY_PATH="$CONDA_PREFIX/share/lfortran/lib"
FC=lfortran cmake \
-DCMAKE_Fortran_FLAGS=--verbose \
-DLFORTRAN_RUNTIME_LIBRARY_PATH=$LIBRARY_PATH \
..
make install
cp $LIBRARY_PATH/liblfortran_runtime.* $CONDA_PREFIX/lib
cd ../
python dev.py build
- name: Test SciPy Special (Specfun, Amos, Mach and Cdflib)
shell: bash -e -x -l {0}
run: |
cd scipy/
micromamba activate scipy-dev
python dev.py test -t scipy.special -v
- name: Test SciPy Minpack
shell: bash -e -x -l {0}
run: |
cd scipy/
micromamba activate scipy-dev
python dev.py test -t scipy.optimize -v
- name: Test SciPy Fitpack
shell: bash -e -x -l {0}
run: |
cd scipy/
micromamba activate scipy-dev
python dev.py test -t scipy.interpolate -v