Skip to content

Commit

Permalink
Merge pull request #6 from NVIDIA/develop
Browse files Browse the repository at this point in the history
Syncing Fork
  • Loading branch information
letmerecall authored Dec 2, 2024
2 parents 8110d1b + 5bb4455 commit 6c39162
Show file tree
Hide file tree
Showing 287 changed files with 15,034 additions and 2,378 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Bug Report
description: File a bug/issue
title: "bug: "
labels: [bug]
labels: ["bug", "status: needs triage"]
body:
- type: markdown
attributes:
Expand Down
49 changes: 49 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Documentation Issue"
labels: ["documentation", "status: needs triage"]
title: "doc: "
description: "Did you find any errors, omissions, or unclear sections in the documentation?"

body:
- type: markdown
attributes:
value: |
Thank you for taking the time to file a complete bug report.
Before submitting your issue, please review the [relevant section](https://github.com/NVIDIA/NeMo-Guardrails/tree/develop/CONTRIBUTING.md#suggesting-enhancements-and-new-features) of our documentation.
- type: checkboxes
attributes:
label: Please also confirm the following
options:
- label: I have searched the [main issue tracker](https://github.com/NVIDIA/NeMo-Guardrails/issues) of NeMo Guardrails repository and believe that this is not a duplicate
required: true
- type: dropdown
attributes:
label: Issue Kind
description: |
What best describes the issue?
options:
- "Improving documentation"
- "Error in existing documentation"
- "Missing documentation"
- "Unclear documentation"
- "Other concerns with documentation"
validations:
required: true

- type: input
attributes:
label: Existing Link
description: |
If the documentation in question exists, please provide a link to it.
placeholder: "https://github.com/NVIDIA/NeMo-Guardrails/blob/develop/docs/"
validations:
required: true

- type: textarea
attributes:
label: Description
description: |
Please provide a detailed description of the feature, including any relevant information. You can use markdown syntax.
validations:
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Feature Request
description: Suggest a new feature
title: "feature: "
labels: [enhancement]
labels: ["enhancement", "status: needs triage"]
body:
- type: checkboxes
attributes:
Expand Down
22 changes: 22 additions & 0 deletions .github/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Exit immediately if a command exits with a non-zero status.
set -e

# Define variables for paths
PACKAGE_DIR="nemoguardrails"
CHAT_UI_SRC="chat-ui"
EXAMPLES_SRC="examples"
CHAT_UI_DST="$PACKAGE_DIR/chat-ui"
EXAMPLES_DST="$PACKAGE_DIR/examples"

# Copy the directories into the package directory
cp -r "$CHAT_UI_SRC" "$CHAT_UI_DST"
cp -r "$EXAMPLES_SRC" "$EXAMPLES_DST"

# Build the wheel using Poetry
poetry build

# Remove the copied directories after building
rm -rf "$CHAT_UI_DST"
rm -rf "$EXAMPLES_DST"
81 changes: 81 additions & 0 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Reusable Tests

on:
workflow_call:
inputs:
os:
description: "Operating system name"
required: true
default: Ubuntu
type: string
image:
description: "Runner image"
required: true
default: ubuntu-latest
type: string
python-version:
description: "Python version to test against"
required: true
default: "3.10"
type: string

defaults:
run:
shell: bash
env:
POETRY_VERSION: 1.8.2

jobs:
tests:
name: ${{ inputs.os }} / Python ${{ inputs.python-version }}
runs-on: ${{ inputs.image }}

steps:
- uses: actions/checkout@v4

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

- name: Get full Python version
id: full-python-version
run: echo "version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> $GITHUB_OUTPUT

- name: Bootstrap poetry (Linux and macOS)
run: |
curl -sSL https://install.python-poetry.org | POETRY_VERSION=${{ env.POETRY_VERSION }} python -
- name: Update PATH (Linux and macOS)
if: runner.os != 'Windows'
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Update PATH for Windows
if: runner.os == 'Windows'
run: echo "$APPDATA\\Python\\Scripts" >> $GITHUB_PATH

- name: Configure poetry
run: poetry config virtualenvs.in-project true

- name: Set up cache
uses: actions/cache@v4
id: cache
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
run: timeout 10s poetry run pip --version || rm -rf .venv

- name: Check Poetry .lock
run: poetry check --lock

- name: Install dependencies
run: poetry install --with dev

- name: Run pre-commit hooks
run: poetry run make pre_commit

- name: Run pytest
run: poetry run pytest -v
98 changes: 0 additions & 98 deletions .github/workflows/build-wheel.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/full-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Full Tests

on:
pull_request:
types: [review_requested, ready_for_review]
paths-ignore:
- "**/*.md"
push:
tags:
- "v*"
workflow_dispatch:

jobs:
call-tests:
strategy:
matrix:
os: [Windows, macOS] # exclude Ubuntu as it is available in pr-tests
python-version: ["3.9", "3.10", "3.11"]
include:
- os: Ubuntu
image: ubuntu-latest
- os: Windows
image: windows-2022
- os: macOS
image: macos-14
fail-fast: false

uses: ./.github/workflows/_test.yml
with:
os: ${{ matrix.os }}
image: ${{ matrix.image }}
python-version: ${{ matrix.python-version }}
42 changes: 42 additions & 0 deletions .github/workflows/lock-threads.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Lock Closed Threads"

on:
schedule:
- cron: "0 0 * * *" # 12:00 midnight UTC, daily

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}

jobs:
lock-issues:
if: github.repository_owner == 'NVIDIA'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: dessant/lock-threads@v5
with:
process-only: issues
issue-inactive-days: 30
issue-comment: >
This issue has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue for related bugs and reference this issue there.
lock-prs:
if: github.repository_owner == 'NVIDIA'
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: dessant/lock-threads@v5
with:
process-only: prs
pr-inactive-days: 30
pr-comment: >
This pull request has been automatically locked since there
has not been any recent activity after it was closed.
Please open a new issue and reference this PR there.
23 changes: 23 additions & 0 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PR Tests

# we don't ignore markdkowns to run pre-commits
on:
push:
paths-ignore:
- ".github/workflows/**"

jobs:
call-tests:
strategy:
matrix:
os: [Ubuntu]
python-version: ["3.9", "3.10", "3.11"]
include:
- os: Ubuntu
image: ubuntu-latest
fail-fast: false
uses: ./.github/workflows/_test.yml
with:
os: ${{ matrix.os }}
image: ${{ matrix.image }}
python-version: ${{ matrix.python-version }}
Loading

0 comments on commit 6c39162

Please sign in to comment.