Skip to content

Commit

Permalink
Merge pull request #48 from nasa/release/1.2.0
Browse files Browse the repository at this point in the history
Release/1.2.0
  • Loading branch information
danielfromearth authored Oct 11, 2023
2 parents dab04e7 + 4709550 commit 88597d1
Show file tree
Hide file tree
Showing 18 changed files with 709 additions and 128 deletions.
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''

---

name: 🐞 Bug report
description: Report a problem to help improve this project
title: "[BUG] "
labels: [bug, triage]
body:
- type: checkboxes
attributes:
label: Is there an existing issue for this?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Problem description
description: |
A concise description of what you're experiencing.

Please explain:

* **what** you tried to achieve,
* **how** you went about it (referring to the code sample), and
* **why** the current behavior is a problem and what output you expected instead.
validations:
required: false
- type: textarea
attributes:
label: Code sample
description: >
Create a [minimal, complete, verifiable example](https://stackoverflow.com/help/mcve).
Please, paste your code between the ``` tickmarks below or link to a [gist](https://gist.github.com/).
value: |
Code run:

```python
```

Traceback:

```text
```
validations:
required: false

- type: textarea
attributes:
label: Anything else?
description: |
Links? References? Anything that will give us more context about the issue you are encountering!

Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature]"
labels: ''
assignees: ''

---

name: Feature request
description: Suggest an idea for this project
title: "[Feature] "
labels: [enhancement]
body:
- type: checkboxes
attributes:
label: Checklist
description: >
Please make sure you check all these items before submitting your feature request.
options:
- label: There are [no similar issues or pull requests](https://github.com/nasa/ncompare/issues) for this yet.
required: true
- type: textarea
attributes:
label: Problem
description: >
A clear and concise description of what you are trying to achieve.
placeholder: >
"I want to be able to [...] but I can't because [...]".
validations:
required: false
- type: textarea
attributes:
label: Solution
description: >
A clear and concise description of what you would want to happen.
For API changes, try to provide a code snippet of what you would like the new API to look like.
validations:
required: false
- type: textarea
attributes:
label: Alternatives
description: >
Please describe any alternative solutions or features you've considered to solve
your problem and why they didn't help.
validations:
required: false
- type: textarea
attributes:
label: Anything else?
description: >
Provide any additional context, screenshots, tracebacks, etc. about the feature here.
validations:
required: false
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Question
about: Ask a question
title: "[Question]"
labels: ''
assignees: ''

---

name: Question
description: Ask a question
title: "[Question] "
labels: [question]
body:
- type: checkboxes
attributes:
label: Checklist
description: >
To help keep this issue tracker clean and focused, please make sure that you have
tried *all* of the following resources before submitting your question.
options:
- label: I looked for [similar issues](https://github.com/nasa/ncompare/issues).
required: true
- label: I looked up my question/problem in a search engine.
required: true
- type: textarea
attributes:
label: Question
description: Please ask your question
validations:
required: true
19 changes: 19 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
GitHub Issue: #NUM _(replace NUM with GitHub issue number)_

### Description

A short description of the changes in this PR.

### Local test steps

_Summarize testing and verification you've done. This includes unit tests or testing with specific data_

### Overview of integration done

_Explain how this change was integration tested. Provide screenshots or logs if appropriate. An example of this would be a local Harmony deployment._

## PR Acceptance Checklist
* [ ] Unit tests added/updated and passing.
* [ ] Integration testing
* [ ] `CHANGELOG.md` updated
* [ ] Documentation updated (if needed).
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ on:
workflow_dispatch:

jobs:
build-linux:
name: Lint and Test
run_tests:
uses: ./.github/workflows/reusable_run_tests.yml

bump_version:
needs: run_tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: 3.9
Expand Down Expand Up @@ -70,35 +74,12 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/heads/main') }}
env:
CURRENT_VERSION: ${{ steps.get-version.outputs.current_version }}
# True if the version already has a 'rc' pre-release identifier
BUMP_RC: ${{ contains(steps.get-version.outputs.current_version, 'rc') }}
# True if the version already has a 'alpha' pre-release identifier
BUMP_A: ${{ contains(steps.get-version.outputs.current_version, 'a') }}
# True if the version already has a 'beta' pre-release identifier
BUMP_B: ${{ contains(steps.get-version.outputs.current_version, 'b') }}
# Remove rc* from end of version string
# Remove rc* from the end of version string
# The ${string%%substring} syntax below deletes the longest match of $substring from back of $string.
run: |
if [ "$BUMP_RC" = true ]; then
poetry version ${CURRENT_VERSION%%rc*}
elif [ "$BUMP_B" = true ]; then
poetry version ${CURRENT_VERSION%%b*}
elif [ "$BUMP_A" = true ]; then
poetry version ${CURRENT_VERSION%%a*}
fi
poetry version ${CURRENT_VERSION%%rc*}
echo "software_version=$(poetry version | awk '{print $2}')" >> $GITHUB_ENV
echo "venue=ops" >> $GITHUB_ENV
- name: Install ncompare
run: poetry install

- name: Lint
run: |
poetry run ruff ncompare
- name: Test with pytest
run: |
poetry run pytest
- name: Commit Version Bump
# If building develop, a release branch, or main then we commit the version bump back to the repo
Expand Down Expand Up @@ -149,4 +130,4 @@ jobs:
env:
POETRY_PYPI_TOKEN_PYPI: ${{secrets.POETRY_PYPI_TOKEN_PYPI}}
run: |
poetry publish
poetry publish
12 changes: 12 additions & 0 deletions .github/workflows/pull-request-received.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Receive PR

# read-only repo token
# no access to secrets
on:
pull_request:
# Sequence of patterns matched against refs/heads
branches: [ feature/**, issue/**, issues/** ]

jobs:
build_and_test:
uses: ./.github/workflows/reusable_run_tests.yml
37 changes: 0 additions & 37 deletions .github/workflows/pull_request.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/reusable_run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This workflow will install Python dependencies, run tests,
# and report test results and code coverage as artifacts. It will
# be called by the workflow that runs tests against new PRs and as
# a first step in the workflow that publishes new Docker images.

name: A reusable workflow to build and run the unit test suite

on:
workflow_call:
workflow_dispatch:

jobs:
build_and_test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Set up Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.3.2

- name: Install ncompare
run: poetry install

- name: Lint
run: |
poetry run ruff ncompare
- name: Run tests with coverage
run: |
poetry run coverage run -m pytest >& test_results.txt
- name: Generate coverage report
if: ${{ always() }}
run: |
poetry run coverage report -m >& coverage_report.txt
poetry run coverage html --dir htmlcov
- name: Archive test results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: test result
path: test_results.txt

- name: Archive code coverage report (plain text)
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: code coverage report (plain text)
path: coverage_report.txt

- name: Archive code coverage report (HTML)
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: code coverage report (HTML)
path: htmlcov/*
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.0]
### Added
- [pull-request/44](https://github.com/nasa/ncompare/pull/44): Added issue templates and markdown guides for CONTRIBUTING and the CODE_OF_CONDUCT
### Changed
- [pull-request/47](https://github.com/nasa/ncompare/pull/47): Added coverage and move test running to separate workflow yml
### Deprecated
### Removed
### Fixed
### Security

## [1.1.0]
### Added
- [commit/4b98808](https://github.com/nasa/ncompare/commit/4b98808cf3d8424da25a226687d304ce7d46738e): Set up dependabot for automated version updates
Expand Down
Loading

0 comments on commit 88597d1

Please sign in to comment.