Skip to content

Commit

Permalink
Updating to latest PPT version. (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
drewoldag authored Oct 1, 2024
1 parent d2048f7 commit 8ca2e8f
Show file tree
Hide file tree
Showing 17 changed files with 195 additions and 193 deletions.
17 changes: 15 additions & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
# Changes here will be overwritten by Copier
_commit: v2.0.2
_commit: v2.0.3
_src_path: gh:lincc-frameworks/python-project-template
author_email: [email protected]
author_name: LINCC Frameworks
custom_install: false
create_example_module: false
custom_install: true
enforce_style:
- ruff_lint
- ruff_format
failure_notification: []
include_benchmarks: true
include_docs: true
include_notebooks: true
mypy_type_checking: none
package_name: fibad
project_license: MIT
project_name: fibad
project_organization: lincc-frameworks
python_versions:
- '3.9'
- '3.10'
- '3.11'
23 changes: 23 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# The .github directory

This directory contains various configurations and .yml files that are used to
define GitHub actions and behaviors.

## Workflows

The .yml files in ``./workflows`` are used to define the various continuous
integration scripts that will be run on your behalf e.g. nightly as a smoke check,
or when you create a new PR.

For more information about CI and workflows, look here: https://lincc-ppt.readthedocs.io/en/latest/practices/ci.html

## Configurations

Templates for various different issue types are defined in ``./ISSUE_TEMPLATE``
and a pull request template is defined as ``pull_request_template.md``. Adding,
removing, and modifying these templates to suit the needs of your project is encouraged.

For more information about these templates, look here: https://lincc-ppt.readthedocs.io/en/latest/practices/issue_pr_templating.html


Or if you still have questions contact us: https://lincc-ppt.readthedocs.io/en/latest/source/contact.html
123 changes: 45 additions & 78 deletions .github/workflows/asv-main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This workflow will run benchmarks with airspeed velocity (asv),
# store the new results in the "benchmarks" branch and publish them
# to a dashboard on GH Pages.

name: Run ASV benchmarks for main

on:
Expand All @@ -10,92 +9,60 @@ on:

env:
PYTHON_VERSION: "3.10"
WORKING_DIR: ${{ github.workspace }}/benchmarks
ASV_VERSION: "0.6.4"
WORKING_DIR: ${{github.workspace}}/benchmarks

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:

setup-python:
runs-on: ubuntu-latest

steps:
- name: Cache Python ${{ env.PYTHON_VERSION }}
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-${{ env.PYTHON_VERSION }}

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"

asv-main:
runs-on: ubuntu-latest
needs: setup-python

permissions:
contents: write

defaults:
run:
working-directory: ${{ env.WORKING_DIR }}

working-directory: ${{env.WORKING_DIR}}
steps:
- name: Checkout main branch of the repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache Python ${{ env.PYTHON_VERSION }}
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-${{ env.PYTHON_VERSION }}

- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade pip
pip install asv==0.6.1 virtualenv tabulate
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create ASV machine config file
run: asv machine --machine gh-runner --yes

- name: Fetch previous results from the "benchmarks" branch
run: |
if git ls-remote --exit-code origin benchmarks > /dev/null 2>&1; then
git merge origin/benchmarks \
--allow-unrelated-histories \
--no-commit
mv ../_results .
fi
- name: Run ASV for the main branch
run: asv run ALL --skip-existing --verbose || true

- name: Submit new results to the "benchmarks" branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: benchmarks
folder: ${{ env.WORKING_DIR }}/_results
target-folder: _results

- name: Generate dashboard HTML
run: |
asv show
asv publish
- name: Deploy to Github pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: ${{ env.WORKING_DIR }}/_html
- name: Set up Python ${{env.PYTHON_VERSION}}
uses: actions/setup-python@v5
with:
python-version: ${{env.PYTHON_VERSION}}
- name: Checkout main branch of the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: pip install "asv[virtualenv]==${{env.ASV_VERSION}}"
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create ASV machine config file
run: asv machine --machine gh-runner --yes
- name: Fetch previous results from the "benchmarks" branch
run: |
if git ls-remote --exit-code origin benchmarks > /dev/null 2>&1; then
git merge origin/benchmarks \
--allow-unrelated-histories \
--no-commit
mv ../_results .
fi
- name: Run ASV for the main branch
run: asv run ALL --skip-existing --verbose || true
- name: Submit new results to the "benchmarks" branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: benchmarks
folder: ${{env.WORKING_DIR}}/_results
target-folder: _results
- name: Generate dashboard HTML
run: |
asv show
asv publish
- name: Deploy to Github pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: ${{env.WORKING_DIR}}/_html
125 changes: 52 additions & 73 deletions .github/workflows/asv-nightly.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This workflow will run daily at 06:45.
# It will run benchmarks with airspeed velocity (asv)
# and compare performance with the previous nightly build.

name: Run benchmarks nightly job

on:
Expand All @@ -11,83 +10,63 @@ on:

env:
PYTHON_VERSION: "3.10"
WORKING_DIR: ${{ github.workspace }}/benchmarks
ASV_VERSION: "0.6.4"
WORKING_DIR: ${{github.workspace}}/benchmarks
NIGHTLY_HASH_FILE: nightly-hash

jobs:

asv-nightly:
runs-on: ubuntu-latest

defaults:
run:
working-directory: ${{ env.WORKING_DIR }}

working-directory: ${{env.WORKING_DIR}}
steps:
- name: Checkout main branch of the repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cache Python ${{ env.PYTHON_VERSION }}
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-${{ env.PYTHON_VERSION }}

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"

- name: Install dependencies
run: |
sudo apt-get update
python -m pip install --upgrade pip
pip install asv==0.6.1 virtualenv
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create ASV machine config file
run: asv machine --machine gh-runner --yes

- name: Fetch previous results from the "benchmarks" branch
run: |
if git ls-remote --exit-code origin benchmarks > /dev/null 2>&1; then
git merge origin/benchmarks \
--allow-unrelated-histories \
--no-commit
mv ../_results .
fi
- name: Get nightly dates under comparison
id: nightly-dates
run: |
echo "yesterday=$(date -d yesterday +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Use last nightly commit hash from cache
uses: actions/cache@v4
with:
path: ${{ env.WORKING_DIR }}
key: nightly-results-${{ steps.nightly-dates.outputs.yesterday }}

- name: Run comparison of main against last nightly build
run: |
HASH_FILE=${{ env.NIGHTLY_HASH_FILE }}
CURRENT_HASH=${{ github.sha }}
if [ -f $HASH_FILE ]; then
PREV_HASH=$(cat $HASH_FILE)
asv continuous $PREV_HASH $CURRENT_HASH --verbose || true
asv compare $PREV_HASH $CURRENT_HASH --sort ratio --verbose
fi
echo $CURRENT_HASH > $HASH_FILE
- name: Update last nightly hash in cache
uses: actions/cache@v4
with:
path: ${{ env.WORKING_DIR }}
key: nightly-results-${{ steps.nightly-dates.outputs.today }}
- name: Set up Python ${{env.PYTHON_VERSION}}
uses: actions/setup-python@v5
with:
python-version: ${{env.PYTHON_VERSION}}
- name: Checkout main branch of the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: pip install "asv[virtualenv]==${{env.ASV_VERSION}}"
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create ASV machine config file
run: asv machine --machine gh-runner --yes
- name: Fetch previous results from the "benchmarks" branch
run: |
if git ls-remote --exit-code origin benchmarks > /dev/null 2>&1; then
git merge origin/benchmarks \
--allow-unrelated-histories \
--no-commit
mv ../_results .
fi
- name: Get nightly dates under comparison
id: nightly-dates
run: |
echo "yesterday=$(date -d yesterday +'%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Use last nightly commit hash from cache
uses: actions/cache@v4
with:
path: ${{env.WORKING_DIR}}
key: nightly-results-${{steps.nightly-dates.outputs.yesterday}}
- name: Run comparison of main against last nightly build
run: |
HASH_FILE=${{env.NIGHTLY_HASH_FILE}}
CURRENT_HASH=${{github.sha}}
if [ -f $HASH_FILE ]; then
PREV_HASH=$(cat $HASH_FILE)
asv continuous $PREV_HASH $CURRENT_HASH --verbose || true
asv compare $PREV_HASH $CURRENT_HASH --sort ratio --verbose
fi
echo $CURRENT_HASH > $HASH_FILE
- name: Update last nightly hash in cache
uses: actions/cache@v4
with:
path: ${{env.WORKING_DIR}}
key: nightly-results-${{steps.nightly-dates.outputs.today}}
Loading

0 comments on commit 8ca2e8f

Please sign in to comment.