Updated for new python versions #77
Workflow file for this run
This file contains hidden or 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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: Build & Tests | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [3.7, 3.8, 3.9] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install flake8 pytest build wheel coverage pytest-cov | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| pip install -e . | |
| - name: Test with pytest | |
| run: | | |
| pytest --cov=. --cov-report=xml | |
| # - name: Upload coverage to Codecov | |
| # uses: codecov/codecov-action@v1 | |
| # with: | |
| # token: ${{ secrets.CODECOV_TOKEN }} | |
| # file: ./coverage.xml | |
| # flags: unittests | |
| # - name: Codacy Coverage Reporter | |
| # # You may pin to the exact commit or the version. | |
| # # uses: codacy/codacy-coverage-reporter-action@3f58b0e12285221110375dffef1150534700246b | |
| # uses: codacy/[email protected] | |
| # with: | |
| # # API project token to retrieve your remote Codacy configuration for the project being analyzed | |
| # project-token: ${{ secrets.CODECOV_TOKEN }} | |
| # # API account token to retrieve your remote Codacy configuration for the project being analyzed | |
| # api-token: # optional | |
| # # Optional comma separated list of coverage reports to send to Codacy | |
| # coverage-reports: ./coverage.xml | |
| - name: Build distributions | |
| run: python setup.py sdist | |
| - name: Publish package to PyPI | |
| if: github.repository == 'CBICA/FigureGenerator' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| uses: pypa/gh-action-pypi-publish@master | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.pypi_password }} |