Skip to content

track SUNDIALS downloads #1473

track SUNDIALS downloads

track SUNDIALS downloads #1473

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: track SUNDIALS downloads
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '06 00 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest requests
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# 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
- name: Run
run: |
python get-sundials-downloads.sh --db data poll ${{ secrets.TRACK_DOWNLOADS }}
python get-sundials-downloads.sh --db data query --date $(echo 01-01-$(date -u +'%Y')) $(date -u '+%m-%d-%Y') all > README.md
- name: Stage data
run: |
git add README.md
git add data/sundials-github-downloads*.txt
- name: Commit data
run: |
git config --global user.name 'Cody Balos'
git config --global user.email 'balos1@users.noreply.github.com'
git commit -am "Automated save of statistics"
git push
- uses: actions/upload-artifact@v4
with:
path: |
*.txt
if: ${{ always() }}