Skip to content

update data & tests #1039

update data & tests

update data & tests #1039

Workflow file for this run

# 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: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
logLevel:
default: 'warning'
jobs:
build:
name: Build and test
# if: needs.check.outputs.code_changed == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
# python-version: [3.5, 3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
fetch-depth: 1 # Because of this, you will fail to push refs to dest repo
# Ideally we should not do the below. Changes in a remote repo might break our tests.
# - name: Submodules - pull latest
# run: git pull origin master --recurse-submodules
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# python -m pip install git+https://github.com/astropy/astropy@master -U
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
#The below is disabled pending https://github.com/jyotisham/jyotisha/runs/1142973750
- name: Build package
run: |
python -m pip install .
pip install setuptools wheel twine
python setup.py bdist_wheel
- name: Build test
run: |
python -c "import jyotisha"
- name: Test with pytest
id: pytest
run: |
pip install pytest
pytest jyotisha_tests
- name: Upload package
uses: pypa/gh-action-pypi-publish@master
if: ${{ github.event_name != 'pull_request' && steps.pytest.conclusion == 'success'}}
with:
user: __token__
skip_existing: true
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Regenerate calendars
run: |
python -m "jyotisha.panchaanga.writer.generation_project"
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.83.1"
- name: Build hugo site pages
id: hugo_build
run: |
cd hugo-source
rm -rf build_github
hugo
cd ..
# MD files are useful for certain bots.
- name: Deploy md
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name != 'pull_request' && steps.hugo_build.conclusion == 'success'}}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./hugo-source/content/output
publish_branch: generated-output
keep_files: true
- name: Deploy html
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name != 'pull_request' && steps.hugo_build.conclusion == 'success'}}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./hugo-source/build_github
force_orphan: true # git history growth - even on non-src branches - makes cloning slow.