Update checkoutScript.py #463
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: create_test_conda_env | |
on: [push] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '>=3.9' | |
- name: Add conda to system path | |
run: | | |
# $CONDA is an env var pointing to root of miniconda dir | |
echo $CONDA/bin >> $GITHUB_PATH | |
- name: Create fre-cli environment | |
run: | | |
# create environment containing all dependencies | |
# the env cannot be explicitly activated in github CI/CD | |
conda env create -f environment.yml --name fre-cli | |
# add conda env's executables to github's PATH equiv. | |
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH | |
# use *conda environment's pip* to install fre-cli | |
# called w/ full path to conda's python for explicitness | |
# called as a module (-m pip) for explicitness | |
$CONDA/envs/fre-cli/bin/python -m pip install --prefix $CONDA/envs/fre-cli . | |
- name: Run pytest in fre-cli environment | |
run: | | |
# try to make sure the right things are in GITHUB_PATH | |
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH | |
# are we talking to the right python? | |
which python | |
python --version | |
$CONDA/envs/fre-cli/bin/python --version | |
# run pytest | |
pytest --junit-xml=pytest_results.xml --config-file=fre/pytest.ini --cov-config=fre/coveragerc --cov-report=xml --cov=fre fre/ | |
# install genbadge to generate coverage badge based on xml | |
pip install genbadge | |
genbadge coverage -v -i coverage.xml -o docs/cov_badge.svg | |
genbadge tests -v -i pytest_results.xml -o docs/pytest_badge.svg | |
- name: Run pylint in fre-cli environment | |
run: | | |
# try to make sure the right things are in GITHUB_PATH | |
echo $CONDA/envs/fre-cli/bin >> $GITHUB_PATH | |
# are we talking to the right python? | |
which python | |
python --version | |
$CONDA/envs/fre-cli/bin/python --version | |
# run pylint, ignored modules avoid warnings arising from code internal to those modules | |
pylint --max-args 6 -ry --ignored-modules netCDF4,cmor fre/ || echo "pylint returned non-zero exit code. preventing workflow from dying with this echo." | |
- name: Install Sphinx and Build Documentation | |
run: | | |
pip install sphinx renku-sphinx-theme sphinx-rtd-theme | |
pip install --upgrade sphinx-rtd-theme | |
sphinx-apidoc --output-dir docs fre/ --separate | |
sphinx-build docs build | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
publish_branch: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: build/ | |
force_orphan: true |