Skip to content

updaing lock file

updaing lock file #552

Workflow file for this run

name: Continuous integration
on:
- push
jobs:
getVersionNumber:
name: Get version number
if: startsWith(github.ref, 'refs/tags/') && github.actor != 'biosimulators-daemon' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.get-version-number.outputs.version }}
steps:
- id: get-version-number
name: Get version number
env:
TAG: ${{ github.ref }}
run: |
version="${TAG/refs\/tags\//}"
echo "::set-output name=version::$version"
build:
name: Lint, test, and compile documentation
if: github.actor != 'biosimulators-daemon' && !contains(github.event.head_commit.message, '[skip ci]')
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Configure Git
run: |
git config --local user.email "[email protected]"
git config --local user.name "biosimulatorsdaemon"
git config pull.rebase false
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Setup pip cache
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/Python
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements.optional.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install pip and setuptools
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
- name: Install Java # for pyNeuroML
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '15'
- name: Install Perl # for BioNetGen
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends perl
- name: Install XPP
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends wget make gcc libx11-dev libc6-dev
cd /tmp
wget http://www.math.pitt.edu/~bard/bardware/xppaut_latest.tar.gz
mkdir xpp
tar zxvf xppaut_latest.tar.gz --directory xpp
cd xpp
make
sudo make install
cd /tmp
rm xppaut_latest.tar.gz
rm -r xpp
- name: Install Singularity # to validate that the Docker image can be converted into a Singularity image
uses: eWaterCycle/setup-singularity@v6
# install package
- name: Install the package
run: |
python -m pip install git+https://github.com/biosimulators/RBApy.git#egg=rbapy
python -m pip install .[all]
# zip COMBINE/OMEX archives
- name: Zip COMBINE/OMEX archives
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends zipcmp
python scripts/zip_examples.py
- id: commit-archives
name: Commit zipped COMBINE/OMEX archives
if: startsWith(github.ref, 'refs/heads/')
env:
HEAD: ${{ github.ref }}
run: |
git stash || true
git pull
set +e
git stash pop || true
git add examples/**/*.omex
git commit -m "chore: Updated COMBINE/OMEX archives [skip ci]"
if [[ $? = 0 ]]; then
archivesChanged=1
else
archivesChanged=0
fi
echo "::set-output name=archivesChanged::$archivesChanged"
branch="${HEAD/refs\/heads\//}"
echo "::set-output name=branch::$branch"
- name: Push the zipped COMBINE/OMEX archives
if: steps.commit-archives.outputs.archivesChanged == '1' && startsWith(github.ref, 'refs/heads/')
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.commit-archives.outputs.branch }}
# lint
- name: Install flake8
run: python -m pip install flake8
- name: Lint the package
run: python -m flake8
# test and upload coverage report to Codecov
- name: Install pytest
run: python -m pip install pytest pytest-cov
- name: Install the requirements for the tests
run: python -m pip install .[tests]
- name: Run the tests
# env:
# BIOSIMULATORS_API_ENDPOINT: https://api.biosimulators.dev/ # uncomment to run tests using the dev deployment
uses: GabrielBB/xvfb-action@v1
with:
run: python -m pytest tests/ --cov=./biosimulators_test_suite --cov-report=xml
- name: Upload the coverage report to Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests
file: ./coverage.xml
# compile documentation
- name: Install the requirements for compiling the documentation
run: python -m pip install -r docs-src/requirements.txt
- name: Compile the documentation
run: |
sphinx-apidoc . setup.py --output-dir docs-src/source --force --module-first --no-toc
mkdir -p docs-src/_static
sphinx-build docs-src docs
release:
name: Release a new version
needs: [getVersionNumber, build]
runs-on: ubuntu-20.04
outputs:
docsChanged: ${{ steps.commit-docs.outputs.docsChanged }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1
ref: deploy
- name: Configure Git
run: |
git config --local user.email "[email protected]"
git config --local user.name "biosimulatorsdaemon"
git config pull.rebase false
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Setup pip cache
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/Python
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements.optional.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install pip and setuptools
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
# install package
- name: Install the package
run: |
python -m pip install git+https://github.com/biosimulators/RBApy.git#egg=rbapy
python -m pip install .[all]
# compile and push documentation
- name: Install the requirements for compiling the documentation
run: python -m pip install -r docs-src/requirements.txt
- name: Compile the documentation
run: |
sphinx-apidoc . setup.py --output-dir docs-src/source --force --module-first --no-toc
mkdir -p docs-src/_static
sphinx-build docs-src docs
- id: commit-docs
name: Commit the compiled documentation
run: |
git stash || true
git pull
set +e
git stash pop || true
git add docs
git add docs-src
git commit -m "chore: Updating compiled documentation [skip ci]"
git checkout .
git clean -f -d
if [[ $? = 0 ]]; then
docsChanged=1
else
docsChanged=0
fi
echo "::set-output name=docsChanged::$docsChanged"
- name: Push the compiled documentation
if: steps.commit-docs.outputs.docsChanged == '1'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: deploy
# Create GitHub release
- name: Create GitHub release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.getVersionNumber.outputs.version }}
release_name: Release ${{ needs.getVersionNumber.outputs.version }}
# Create PyPI release
- name: Install pandoc
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends wget
wget https://github.com/jgm/pandoc/releases -O /tmp/pandocVersions.html
urlPart=`grep "\.deb" /tmp/pandocVersions.html | head -n 1 | cut -d'/' -f2-7 | cut -d'"' -f1`
wget "https://github.com/$urlPart" -O /tmp/pandoc.deb
sudo dpkg -i /tmp/pandoc.deb
rm /tmp/pandocVersions.html
rm /tmp/pandoc.deb
- name: Convert README to .rst format
run: pandoc --from=gfm --output=README.rst --to=rst README.md
- name: Install twine
run: |
python -m pip install wheel twine
- name: Create packages to upload to PyPI
run: |
python setup.py sdist
python setup.py bdist_wheel
- name: Upload packages to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*