Add debug test and run at CI #61
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
llvmdev=16.0.6 | |
- 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 | |
- name: Run LFortran Misc Tests | |
if: ${{ !startsWith(matrix.os, 'windows-2019') }} | |
shell: bash -e -x -l {0} | |
run: | | |
lfortran -g --debug-with-line-column tests/expr2.f90 | |
ls -l | |
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 |