-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github actions for testing MRs (#5)
Create workflows for linting, pytest, and changelogs
- Loading branch information
Showing
9 changed files
with
122 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Restrict all files related to deploying to require maintainer approval. | ||
|
||
.github/workflows/ @epic-open-source/ai-trust-and-assurance-core | ||
.github/CODEOWNERS @epic-open-source/ai-trust-and-assurance-core | ||
src/seisomemeter/_version.py @epic-open-source/ai-trust-and-assurance-core | ||
pyproject.toml @epic-open-source/ai-trust-and-assurance-core | ||
setup.cfg @epic-open-source/ai-trust-and-assurance-core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Enforce changelog fragment creation | ||
|
||
on: | ||
pull_request: {} | ||
|
||
permissions: "read-all" | ||
|
||
jobs: | ||
check-changelog-entry: | ||
name: changelog entry | ||
runs-on: ubuntu-latest | ||
# skip job if label is present | ||
if: "!contains(github.event.pull_request.labels.*.name, 'skip changelog')" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
# `towncrier check` needs full history to compare | ||
fetch-depth: 0 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- name: Install towncrier | ||
run: | | ||
pip install --upgrade pip | ||
pip install towncrier | ||
- name: Validate changelog | ||
run: | | ||
if ! towncrier check --compare-with origin/${{ github.base_ref }}; then | ||
echo "Please add a change fragment; see https://github.com/epic-open-source/seismometer/blob/main/changelog/README.rst for details." | ||
false | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: CI | ||
|
||
on: | ||
push: {} | ||
pull_request: {} | ||
workflow_dispatch: {} | ||
|
||
permissions: "read-all" | ||
|
||
jobs: | ||
run-linting: | ||
name: linting via pre-commit | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- name: Install pre-commit | ||
run: | | ||
pip install --upgrade pip | ||
pip install pre-commit | ||
- name: Run pre-commit steps | ||
run: | | ||
pre-commit run --all-files | ||
run-tests: | ||
name: tests via pytest | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[dev,audit] | ||
- name: Run tests | ||
run: | | ||
pytest . | ||
- name: Upload coverage | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-data | ||
path: coverage/coverage.xml | ||
if-no-files-found: error |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
This directory contains changelog `fragments`; small per-fix or per-PR files **ReST**-formatted text that will | ||
be added to ``CHANGES.rst`` by `towncrier <https://towncrier.readthedocs.io/en/latest/>`_. | ||
|
||
The result is a documentation page meant for **users**. With this focus in mind, describe the change in the user | ||
experience over the internal implementation detail. | ||
|
||
Use full sentences, in the past tense, with proper punctuation, examples:: | ||
|
||
Added support for displaying a fairness audit visualization. | ||
|
||
Upgraded event merging to be compatible with pandas v2. | ||
|
||
Each file should be named ``<ISSUE>.<TYPE>.rst``, where ``<ISSUE>`` is an issue number, and ``<TYPE>`` is one of | ||
the five towncrier types: feature, bugfix, doc, removal, or misc. | ||
|
||
Such as ``1234.bugfix.rst`` or ``2345.doc.rst`` | ||
|
||
If a pull request fixes an issue, use that number in its file name. If there is no issue, then use the pull | ||
request instead. | ||
|
||
If your change does not deserve a changelog entry, apply the `skip changelog` GitHub label to your pull request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
[build-system] | ||
requires = ["setuptools >= 65.6.0", "wheel >= 0.36.0"] | ||
build-backend = 'setuptools.build_meta' | ||
|
||
[tool.towncrier] | ||
package = "seismometer" | ||
package_dir = "src" | ||
filename = "docs/release_notes/index.rst" | ||
directory = "changelog" | ||
issue_format = "`#{issue} <https://github.com/epic-open-source/seismometer/issues/{issue}>`__" | ||
title_format = "{version}" | ||
underlines = ["-","~"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters