Skip to content

Commit 98f1eaf

Browse files
committed
First Draft integration
1 parent b88c5d5 commit 98f1eaf

File tree

173 files changed

+34158
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+34158
-2
lines changed

.github/workflows/codeql.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
pull_request:
16+
# The branches below must be a subset of the branches above
17+
branches: [ "master", "dev", "release/*" ]
18+
19+
jobs:
20+
code_ql:
21+
name: CodeQL Analysis
22+
runs-on: ubuntu-latest
23+
permissions:
24+
actions: read
25+
contents: read
26+
security-events: write
27+
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
language: [ 'python' ]
32+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
33+
# Use only 'java' to analyze code written in Java, Kotlin or both
34+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
35+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v3
40+
41+
# Initializes the CodeQL tools for scanning.
42+
- name: Initialize CodeQL
43+
uses: github/codeql-action/init@v2
44+
with:
45+
languages: ${{ matrix.language }}
46+
# If you wish to specify custom queries, you can do so here or in a config file.
47+
# By default, queries listed here will override any specified in a config file.
48+
# Prefix the list here with "+" to use these queries and those in the config file.
49+
50+
# 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
51+
# queries: security-extended,security-and-quality
52+
53+
54+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
55+
# If this step fails, then you should remove it and run the build manually (see below)
56+
# - name: Autobuild
57+
# uses: github/codeql-action/autobuild@v2
58+
59+
# ℹ️ Command-line programs to run using the OS shell.
60+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
61+
62+
# If the Autobuild fails above, remove it and uncomment the following three lines.
63+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
64+
65+
# - run: |
66+
# echo "Run, Build Application using script"
67+
# ./location_of_script_within_repo/buildscript.sh
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v2
71+
with:
72+
category: "/language:${{matrix.language}}"

.github/workflows/coverage.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
pull_request:
6+
paths:
7+
- prog_models
8+
9+
jobs:
10+
coverage:
11+
timeout-minutes: 30
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ['3.10']
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies cache
23+
uses: actions/cache@v2
24+
with:
25+
path: ~/.cache/pip
26+
key: pip-cache
27+
- name: Install additional dependencies
28+
run: |
29+
pip install coverage
30+
pip install importlib_metadata
31+
- name: Update
32+
run: pip install --upgrade --upgrade-strategy eager -e .
33+
- name: Run coverage
34+
run: |
35+
coverage run -m tests.test_base_models
36+
coverage run -a -m tests.test_battery
37+
coverage run -a -m tests.test_calc_error
38+
coverage run -a -m tests.test_centrifugal_pump
39+
coverage run -a -m tests.test_composite
40+
coverage run -a -m tests.test_datasets
41+
coverage run -a -m tests.test_dict_like_matrix_wrapper
42+
coverage run -a -m tests.test_direct
43+
coverage run -a -m tests.test_estimate_params
44+
coverage run -a -m tests.test_ensemble
45+
coverage run -a -m tests.test_linear_model
46+
coverage run -a -m tests.test_pneumatic_valve
47+
coverage run -a -m tests.test_powertrain
48+
coverage run -a -m tests.test_serialization
49+
coverage run -a -m tests.test_sim_result
50+
coverage run -a -m tests.test_uav_model
51+
coverage xml -i
52+
- name: "Upload coverage to Codecov"
53+
uses: codecov/codecov-action@v3

.github/workflows/greetings.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Greetings
2+
3+
on: [pull_request_target]
4+
5+
jobs:
6+
greeting:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
steps:
12+
- uses: actions/first-interaction@v1
13+
with:
14+
repo-token: ${{ secrets.GITHUB_TOKEN }}
15+
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"

.github/workflows/pr-messages.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Print PR Message - Non Release
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- 'dev'
7+
types: [opened]
8+
9+
jobs:
10+
pr_msg:
11+
timeout-minutes: 5
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Auto Comment
15+
uses: wow-actions/auto-comment@v1
16+
with:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
pullRequestOpened: >
19+
Thank you for opening this PR. Each PR into dev requires a code review. For the code review, look at the following:
20+
21+
- [ ] Reviewer (someone other than author) should look for bugs, efficiency, readability, testing, and coverage in examples (if relevant).
22+
23+
- [ ] Ensure that each PR adding a new feature should include a test verifying that feature.
24+
25+
- [ ] All errors from static analysis must be resolved.
26+
27+
- [ ] Review the test coverage reports (if there is a change) - will be added as comment on PR if there is a change
28+
29+
- [ ] Review the software benchmarking results (if there is a change) - will be added as comment on PR
30+
31+
- [ ] Any added dependencies are included in requirements.txt, setup.py, and dev_guide.rst (this document)
32+
33+
- [ ] All warnings from static analysis must be reviewed and resolved - if deemed appropriate.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Print Benchmarking
2+
3+
on: pull_request
4+
5+
jobs:
6+
benchmark_branch:
7+
timeout-minutes: 20
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: ['3.9']
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
python -m pip install -e .
22+
- name: benchmark
23+
id: bench
24+
shell: bash
25+
run: |
26+
bench=$(python -m tests.benchmarking)
27+
# V To support multiline strings V
28+
bench="${bench//'%'/'%25'}"
29+
bench="${bench//$'\n'/'%0A'}"
30+
bench="${bench//$'\r'/'%0D'}"
31+
echo "::set-output name=bench::$bench"
32+
- name: Clone prog_models
33+
uses: actions/checkout@v2
34+
with:
35+
repository: nasa/prog_models
36+
ref: ${{ github.event.pull_request.base.ref }}
37+
path: prog_models_target
38+
- name: Downgrade
39+
run: |
40+
python -m pip uninstall -y prog_models
41+
python -m pip install -e ./prog_models_target
42+
cd prog_models_target
43+
- name: benchmark-pre
44+
id: bench-pre
45+
shell: bash
46+
run: |
47+
bench=$(python -m tests.benchmarking)
48+
# V To support multiline strings V
49+
bench="${bench//'%'/'%25'}"
50+
bench="${bench//$'\n'/'%0A'}"
51+
bench="${bench//$'\r'/'%0D'}"
52+
echo "::set-output name=bench::$bench"
53+
- name: Auto Comment
54+
uses: wow-actions/auto-comment@v1
55+
with:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
pullRequestOpened: >
58+
Benchmarking Results
59+
60+
From:
61+
62+
${{steps.bench-pre.outputs.bench}}
63+
64+
To:
65+
66+
${{steps.bench.outputs.bench}}
67+
68+
pullRequestSynchronize: >
69+
Benchmarking Results [Update]
70+
71+
From:
72+
73+
${{steps.bench-pre.outputs.bench}}
74+
75+
76+
To:
77+
78+
79+
${{steps.bench.outputs.bench}}

0 commit comments

Comments
 (0)