Skip to content

Commit

Permalink
Reusable workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgroot42 committed Jan 10, 2024
1 parent 3dc5011 commit 3e6ba5e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate and Deploy Documentation
name: Documentation

on:
push:
Expand All @@ -8,25 +8,9 @@ on:
jobs:
build-documentation:
runs-on: ubuntu-latest
uses: ./.github/workflows/setup_env.yml

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9' # Specify your Python version

- name: Install pdoc
run: pip install pdoc3 # Install pdoc or pdoc3

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
if [ -f requirements_workflow.txt ]; then pip install -r requirements_workflow.txt; fi
- name: Generate Documentation
run: |
rm -r docs/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Python Tests
name: Setup environment

on: [push, pull_request]
on:
workflow_call:

jobs:
test:
env_setup:
runs-on: ubuntu-latest

steps:
Expand All @@ -23,7 +24,3 @@ jobs:
python -m pip install --upgrade pip
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
if [ -f requirements_workflow.txt ]; then pip install -r requirements_workflow.txt; fi
- name: Run tests
run: |
pytest
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Tests

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
uses: ./.github/workflows/setup_env.yml

- name: Run tests
run: |
pytest

0 comments on commit 3e6ba5e

Please sign in to comment.