Skip to content

Commit

Permalink
add yaml files to gh workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Sarah Yurick <[email protected]>
  • Loading branch information
sarahyurick committed Sep 18, 2024
1 parent c89c115 commit d560fe1
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/auto-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Auto-Label for Write Access and Python Files
on:
pull_request:
types: [opened]
jobs:
auto-label:
runs-on: ubuntu-latest
steps:
- name: Checkout the PR code
uses: actions/checkout@v3
- name: Check if the PR author has write access
id: write-access
uses: octokit/[email protected]
with:
route: GET /repos/${{ github.repository }}/collaborators/${{ github.event.pull_request.user.login }}/permission
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Verify Python files are modified
id: python-files
run: |
git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '.py' || echo 'no-python'
continue-on-error: true
- name: Add label if conditions are met
if: ${{ steps.write-access.outputs.permission == 'write' && steps.python-files.outputs.result != 'no-python' }}
uses: actions-ecosystem/action-add-labels@v1
with:
labels: "gpuci"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/gpuci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "GPU CI/CD"

on:
pull_request:
branches:
- 'main'
- 'r**'
types: [ labeled, synchronize ]

jobs:
gpu-test:
runs-on: self-hosted
if: ${{ github.event.label.name == 'gpuci' || github.event_name == 'synchronize' }}

steps:
- name: Run nvidia-smi test
run: |
whoami
nvidia-smi
- name: Checkout the PR code
uses: actions/checkout@v3

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

- name: Install NeMo-Curator and PyTest
run: |
pip install wheel cython
RAPIDS_NIGHTLY=1 pip install --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple ".[cuda12x]"
pip install pytest
- name: Verify installation
run: |
pip list
- name: Run PyTests with GPU mark
run: |
python -m pytest -m gpu

0 comments on commit d560fe1

Please sign in to comment.