diff --git a/.github/workflows/generate_documentation.yml b/.github/workflows/documentation.yml similarity index 53% rename from .github/workflows/generate_documentation.yml rename to .github/workflows/documentation.yml index 2943da9..5c928bc 100644 --- a/.github/workflows/generate_documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,4 +1,4 @@ -name: Generate and Deploy Documentation +name: Documentation on: push: @@ -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/ diff --git a/.github/workflows/python-test.yml b/.github/workflows/setup_env.yml similarity index 85% rename from .github/workflows/python-test.yml rename to .github/workflows/setup_env.yml index 3152a4e..5b35503 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/setup_env.yml @@ -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: @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..483d511 --- /dev/null +++ b/.github/workflows/test.yml @@ -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