Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into ipynb-benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
aqitya committed Jul 6, 2023
2 parents 96253d6 + 98f1eaf commit 3bff03c
Show file tree
Hide file tree
Showing 173 changed files with 34,158 additions and 2 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master", "dev", "release/*" ]

jobs:
code_ql:
name: CodeQL Analysis
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
53 changes: 53 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Coverage

on:
push:
pull_request:
paths:
- prog_models

jobs:
coverage:
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-cache
- name: Install additional dependencies
run: |
pip install coverage
pip install importlib_metadata
- name: Update
run: pip install --upgrade --upgrade-strategy eager -e .
- name: Run coverage
run: |
coverage run -m tests.test_base_models
coverage run -a -m tests.test_battery
coverage run -a -m tests.test_calc_error
coverage run -a -m tests.test_centrifugal_pump
coverage run -a -m tests.test_composite
coverage run -a -m tests.test_datasets
coverage run -a -m tests.test_dict_like_matrix_wrapper
coverage run -a -m tests.test_direct
coverage run -a -m tests.test_estimate_params
coverage run -a -m tests.test_ensemble
coverage run -a -m tests.test_linear_model
coverage run -a -m tests.test_pneumatic_valve
coverage run -a -m tests.test_powertrain
coverage run -a -m tests.test_serialization
coverage run -a -m tests.test_sim_result
coverage run -a -m tests.test_uav_model
coverage xml -i
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
15 changes: 15 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Greetings

on: [pull_request_target]

jobs:
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: "Thank you for your contributions. If you haven't already, please send a signed Contributor License Agreement (CLA) to Christopher Teubert (christopher.a.teubert@nasa.gov). CLAs can be found here: https://github.com/nasa/prog_models/tree/master/forms. Also, make sure you're familiar with the developer notes and contributing sections of our developers guide, https://nasa.github.io/progpy/dev_guide.html#notes-for-developers"
33 changes: 33 additions & 0 deletions .github/workflows/pr-messages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Print PR Message - Non Release

on:
pull_request:
branches:
- 'dev'
types: [opened]

jobs:
pr_msg:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Auto Comment
uses: wow-actions/auto-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pullRequestOpened: >
Thank you for opening this PR. Each PR into dev requires a code review. For the code review, look at the following:
- [ ] Reviewer (someone other than author) should look for bugs, efficiency, readability, testing, and coverage in examples (if relevant).
- [ ] Ensure that each PR adding a new feature should include a test verifying that feature.
- [ ] All errors from static analysis must be resolved.
- [ ] Review the test coverage reports (if there is a change) - will be added as comment on PR if there is a change
- [ ] Review the software benchmarking results (if there is a change) - will be added as comment on PR
- [ ] Any added dependencies are included in requirements.txt, setup.py, and dev_guide.rst (this document)
- [ ] All warnings from static analysis must be reviewed and resolved - if deemed appropriate.
79 changes: 79 additions & 0 deletions .github/workflows/print-benchmarking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Print Benchmarking

on: pull_request

jobs:
benchmark_branch:
timeout-minutes: 20
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['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 -e .
- name: benchmark
id: bench
shell: bash
run: |
bench=$(python -m tests.benchmarking)
# V To support multiline strings V
bench="${bench//'%'/'%25'}"
bench="${bench//$'\n'/'%0A'}"
bench="${bench//$'\r'/'%0D'}"
echo "::set-output name=bench::$bench"
- name: Clone prog_models
uses: actions/checkout@v2
with:
repository: nasa/prog_models
ref: ${{ github.event.pull_request.base.ref }}
path: prog_models_target
- name: Downgrade
run: |
python -m pip uninstall -y prog_models
python -m pip install -e ./prog_models_target
cd prog_models_target
- name: benchmark-pre
id: bench-pre
shell: bash
run: |
bench=$(python -m tests.benchmarking)
# V To support multiline strings V
bench="${bench//'%'/'%25'}"
bench="${bench//$'\n'/'%0A'}"
bench="${bench//$'\r'/'%0D'}"
echo "::set-output name=bench::$bench"
- name: Auto Comment
uses: wow-actions/auto-comment@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pullRequestOpened: >
Benchmarking Results
From:
${{steps.bench-pre.outputs.bench}}
To:
${{steps.bench.outputs.bench}}
pullRequestSynchronize: >
Benchmarking Results [Update]
From:
${{steps.bench-pre.outputs.bench}}
To:
${{steps.bench.outputs.bench}}
Loading

0 comments on commit 3bff03c

Please sign in to comment.