Skip to content

test no type_checking and quotes #1820

test no type_checking and quotes

test no type_checking and quotes #1820

Workflow file for this run

name: Tests
on: [push]
jobs:
tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest, macos-13]
mpi: ["none", openmpi] # mpich
python: ["3.10", "3.13"]
exclude:
- os: macos-latest
mpi: mpich
python: "3.10"
# Only run tests if there is no [skipci] or [skip ci] in the commit message
if: |
!startsWith(github.event.head_commit.message, '[skip ci]') &&
!startsWith(github.event.head_commit.message, '[skipci]')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
# Unfortunately we must use different keys to store the same data,
# otherwise GitHub will complain when multiple jobs are going to
# store it
- name: Cache PySM3 data files
id: cache-pysm3
uses: actions/cache@v4
with:
path: ~/pysm3-data
key: pysm3-data-${{ runner.os }}-${{ matrix.python }}-${{ matrix.mpi }}-${{ secrets.CACHE_VERSION }}
- name: Register PySM3 data path
run: |
echo "PYSM_LOCAL_DATA=$HOME/pysm3-data" >> $GITHUB_ENV
- name: Download PySM3 data files
if: steps.cache-pysm3.outputs.cache_hit != 'true'
run: |
rm -rf "$PYSM_LOCAL_DATA" && git clone https://github.com/galsci/pysm-data "$PYSM_LOCAL_DATA"
- name: Install basic dependencies (MPI, FFTW, poetry, IMO)
run: |
./bin/install-deps.sh ${{ matrix.mpi }}
pip install poetry==2.1 poetry-plugin-export
mkdir -p $HOME/.config/litebird_imo
echo -e "[[repositories]]\nlocation = \"$(pwd)/test/mock_imo/\"\nname = \"Mock IMO\"" | tee $HOME/.config/litebird_imo/imo.toml
- name: Install litebird_sim dependencies
run: |
poetry export --without-hashes -o requirements.txt
pip install --upgrade pip
pip install -r requirements.txt
pip install pytest-cov
if [ "${{ matrix.mpi }}" != "none" ]; then
pip install mpi4py
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
git clone --recursive https://github.com/anand-avinash/BrahMap.git
(cd BrahMap && pip install .)
rm -rf BrahMap
fi
fi
env:
DUCC0_OPTIMIZATION: none
- name: Tests
run: bash ./bin/run_tests.sh
- name: Tests MPICH
if: ${{ matrix.mpi == 'mpich' }}
run: |
# See issue #457: <https://github.com/litebird/litebird_sim/issues/457>
if [[ "$(uname)" == "Darwin" ]]; then
export HDF5_USE_FILE_LOCKING=FALSE
fi
for proc in 1 2 ; do
echo "Running MPI test ($MPI) with $proc processes"
PYTHONPATH=. mpiexec -n $proc python3 ./test/test_mpi.py
PYTHONPATH=. mpiexec -n $proc python3 ./test/test_detector_blocks.py
echo "Running MPI test ($MPI) with 4 processes"
PYTHONPATH=. mpiexec --map-by :OVERSUBSCRIBE -n 4 python3 ./test/test_mpi_n4.py
done
- name: Tests OpenMPI
if: ${{ matrix.mpi == 'openmpi' }}
run: |
# See issue #457: <https://github.com/litebird/litebird_sim/issues/457>
if [[ "$(uname)" == "Darwin" ]]; then
export HDF5_USE_FILE_LOCKING=FALSE
fi
for proc in 1 2 ; do
echo "Running MPI test ($MPI) with $proc processes"
PYTHONPATH=. mpiexec -n $proc python3 ./test/test_mpi.py
PYTHONPATH=. mpiexec -n $proc python3 ./test/test_detector_blocks.py
echo "Running MPI test ($MPI) with 4 processes"
PYTHONPATH=. mpiexec --map-by :OVERSUBSCRIBE -n 4 python3 ./test/test_mpi_n4.py
done
- name: Coverage comment
uses: py-cov-action/python-coverage-comment-action@v3
if: runner.os == 'Linux'
with:
GITHUB_TOKEN: ${{ github.token }}