Merge pull request #22 from henrysky/dependabot/github_actions/codeco… #271
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, 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 | |
python-version: "3.10" | |
- 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 . # install package in editable mode for doctests | |
python -m pip uninstall -y mygaiadb # uninstall package to test editable install | |
python -m pip install . | |
npm install -g junit-report-merger | |
- name: Cache my astro data | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/my_astro_data/ | |
key: mygaiadb-${{ runner.os }}-2024aug26 | |
- name: Test | |
run: | | |
python -m pytest -v ./tests --cov mygaiadb --junitxml=junit.xml --cov-report=xml --doctest-glob="*.rst" --doctest-continue-on-failure ./tests/ ./README.rst | |
- name: Upload results to Codecov | |
uses: codecov/codecov-action@v5 | |
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' |