Pass codecov token directly #306
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, pull_request, workflow_dispatch] | |
jobs: | |
examples: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: False | |
matrix: | |
python-version: | |
- "3.6" | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get install libpython2.7 # required by paup | |
python -m pip install --upgrade pip | |
- name: Install paup | |
run: | | |
temp_dir=$(mktemp -d) | |
wget -P ${temp_dir} http://phylosolutions.com/paup-test/paup4a168_ubuntu64.gz | |
gunzip ${temp_dir}/paup4a168_ubuntu64.gz | |
chmod +x ${temp_dir}/paup4a168_ubuntu64 | |
sudo mv ${temp_dir}/paup4a168_ubuntu64 /usr/local/bin/paup | |
echo "export DENDROPY_PAUP_EXECUTABLE_PATH=/usr/local/bin/paup" >> "${GITHUB_ENV}" | |
- name: Install dendropy | |
run: | | |
python -m pip install . | |
- name: Run examples | |
run: | | |
cd docs/source/examples | |
# only allow known failures | |
# and enforce removal of working examples from known failures | |
for f in *.py; do | |
echo "${f}" | |
if timeout 60 python "${f}" && ! grep -q "${f}" backlogged-fail-whitelist.txt; then | |
: | |
elif grep -q "${f}" backlogged-fail-whitelist.txt; then | |
: | |
else | |
echo FAIL "${f}" | |
exit 1 | |
fi | |
done | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install ruff==0.0.292 | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Lint with ruff | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
./lint.sh | |
tests: | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: False | |
matrix: | |
python-version: | |
- "2.7" | |
- "3.5" | |
- "3.6" | |
- "3.7" | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
continue-on-error: true | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install python2 libpython2.7 # required by paup | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Install paup | |
run: | | |
temp_dir=$(mktemp -d) | |
wget -P ${temp_dir} http://phylosolutions.com/paup-test/paup4a168_ubuntu64.gz | |
gunzip ${temp_dir}/paup4a168_ubuntu64.gz | |
chmod +x ${temp_dir}/paup4a168_ubuntu64 | |
sudo mv ${temp_dir}/paup4a168_ubuntu64 /usr/local/bin/paup | |
echo "export DENDROPY_PAUP_EXECUTABLE_PATH=/usr/local/bin/paup" >> "${GITHUB_ENV}" | |
- name: Python2 compatibility workaround # TODO remove when Python2 compatibility dropped | |
if: matrix.python-version == '2.7' | |
run: | | |
rm tests/dendropy | |
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo python2 | |
python2 -m pip install setuptools --upgrade | |
python2 setup.py test | |
- name: Test with setup.py | |
if: matrix.python-version != '2.7' | |
run: | | |
python setup.py test | |
coverage: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@master | |
- name: Setup Python | |
uses: actions/setup-python@master | |
with: | |
python-version: 3.8 | |
- name: Install paup | |
run: | | |
sudo apt-get install libpython2.7 # required by paup | |
temp_dir=$(mktemp -d) | |
wget -P ${temp_dir} http://phylosolutions.com/paup-test/paup4a168_ubuntu64.gz | |
gunzip ${temp_dir}/paup4a168_ubuntu64.gz | |
chmod +x ${temp_dir}/paup4a168_ubuntu64 | |
sudo mv ${temp_dir}/paup4a168_ubuntu64 /usr/local/bin/paup | |
echo "export DENDROPY_PAUP_EXECUTABLE_PATH=/usr/local/bin/paup" >> "${GITHUB_ENV}" | |
- name: Install coverage dependencies | |
run: | | |
python3 -m pip install pytest | |
python3 -m pip install pytest-cov | |
- name: Generate coverage report | |
run: | | |
python3 -m pytest tests --cov=tests/dendropy --cov-report=xml | |
- uses: codecov/codecov-action@v4 | |
with: | |
token: ae13d715-bae4-4e6d-9dce-f47e7d7c7c01 | |
flags: unittests # optional | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) | |
packaging-bdist: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install build tools | |
run: python3 -m pip install pip setuptools wheel --upgrade | |
- name: Build bdist | |
run: | | |
python3 setup.py bdist_wheel | |
tree dist | |
- name: Upgrade pip | |
run: python3 -m pip install pip --upgrade | |
- name: Install from bdist | |
run: python3 -m pip install dist/*.whl | |
- name: Test install | |
run: | | |
find . -type f -name '*.py' -exec rm {} \; | |
python3 -c "import dendropy; print(dendropy.__version__)" | |
packaging-sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install build tools | |
run: python3 -m pip install pip setuptools wheel --upgrade | |
- name: Build sdist | |
run: | | |
python3 setup.py sdist | |
tree dist | |
- name: Install from sdist | |
run: python3 -m pip install dist/*.tar.gz | |
- name: Test install | |
run: | | |
find . -type f -name '*.py' -exec rm {} \; | |
python3 -c "import dendropy; print(dendropy.__version__)" | |
packaging-source: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Upgrade pip | |
run: python3 -m pip install pip --upgrade | |
- name: Install from source | |
run: python3 -m pip install . | |
- name: Test install | |
run: | | |
find . -type f -name '*.py' -exec rm {} \; | |
python3 -c "import dendropy; print(dendropy.__version__)" | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
continue-on-error: true | |
with: | |
python-version: 3.9 | |
- name: Upgrade pip | |
run: python3 -m pip install pip --upgrade | |
- name: Install from source | |
run: python3 -m pip install . | |
- name: Install documentation build dependencies | |
run: python3 -m pip install -r docs/requirements.txt | |
- name: Build documentation | |
run: make -C docs html | |
- name: Deploy to netlify | |
if: github.ref == 'refs/heads/main' | |
uses: jsmrcaga/[email protected] | |
with: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
NETLIFY_DEPLOY_MESSAGE: "Prod deploy v${{ github.ref }}" | |
NETLIFY_DEPLOY_TO_PROD: true | |
install_command: "echo Skipping installing the dependencies" | |
build_command: "echo Skipping building the web files" | |
build_directory: docs/build/html | |
deploy: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: | |
- examples | |
- lint | |
- tests | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install setuptools wheel twine | |
- run: python setup.py sdist bdist_wheel | |
- name: Publish package | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} |