Skip to content

improve testing on compile() function #230

improve testing on compile() function

improve testing on compile() function #230

Workflow file for this run

name: CI
on: [push, pull_request]
defaults:
run:
shell: bash -l {0}
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
MY_ASTRO_DATA: ${{ github.workspace }}/my_astro_data/
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
channels: conda-forge
auto-update-conda: true
- name: Set environment variables on Mac OS
if: matrix.os == 'macos-latest'
run: |
echo "CPPFLAGS=-I$CONDA_PREFIX/include" >> $GITHUB_ENV
echo "LDFLAGS=-L$CONDA_PREFIX/lib" >> $GITHUB_ENV
echo "REPAIR_LIBRARY_PATH=$CONDA_PREFIX/lib" >> $GITHUB_ENV
echo "$CONDA_PREFIX/bin" >> $GITHUB_PATH
- name: Set environment variables on Windows
if: matrix.os == 'windows-latest'
run: |
echo "INCLUDE=$CONDA_PREFIX\\Library\\include" >> $GITHUB_ENV
echo "LIB=$CONDA_PREFIX\\Library\\lib" >> $GITHUB_ENV
echo "LIBPATH=$CONDA_PREFIX\\Library\\lib" >> $GITHUB_ENV
echo "$CONDA_PREFIX\\Library\\bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
conda install --yes --file requirements.txt
python -m pip install -r requirements-dev.txt
python -m pip install -e .
- name: Cache my astro data
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/my_astro_data/
key: mygaiadb-${{ runner.os }}-2024aug19
- name: Test
run: |
python -m pytest -v ./tests --cov ./src/mygaiadb --junitxml=junit.xml --cov-report=xml
- name: Upload results to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Cleanup files from cache
run: |
python tests/cleanup.py 'i_swear_i_am_on_gh_action'