chaitanyarora / github-trial

0 stars 0 forks source link

faltu #1

Open chaitanyarora opened 2 months ago

chaitanyarora commented 2 months ago

### GitHub Workflow CI/CD Pipeline for "Animation-Tool" Blender Addon This document provides a guide to the GitHub Actions CI/CD pipeline used for the Animation-Tool Blender addon project. The pipeline automates the installation of dependencies, testing, and log management.

  1. Workflow Trigger The GitHub Actions workflow is triggered by specific events such as:

Push events to a particular branch (e.g., main, dev). Pull requests targeting a specific branch. Manual triggers via GitHub's workflow dispatch. These events automatically activate the pipeline to ensure the latest code is validated and tested.

  1. Path Structure When the pipeline is triggered, the contents of your repository are stored under the following path:

arduino Copy code /home/runner/work/name_of_your_repo/name_of_your_repo This is where you can access the repository files within the CI/CD environment. All further steps in the workflow will reference this path for file access and modifications.

  1. Dependency Management Our Blender addon, Animation-Tool, depends on an external Python package, scipy. As a result, the pipeline installs scipy using Blender's Python environment.

Step for Installing Dependencies: yaml Copy code

  1. Running Tests We execute tests on the addon to ensure functionality using Python scripts. These tests are stored in .py files, which are created and executed during the pipeline. Here is an example step for running the tests:

yaml Copy code

  1. Log File Creation and Updates After running the tests, the output is written to a log file. This file is created or updated within the repository itself to track the test results.

Example of Log File Update: yaml Copy code

  1. Committing Log Changes Because the log file is updated on the cloud, the changes need to be committed back to the repository. This requires setting up permissions to allow the CI workflow to push commits to the repository. The user pushing the code must have permission to commit changes on the branch.

Commit Log Changes: yaml Copy code

Make sure the Write Permissions and Commit Changes options are enabled for the GitHub Actions workflow. The user who triggers the workflow must also have write access to the branch where the changes are being pushed.

Conclusion This pipeline ensures that:

Dependencies like scipy are installed automatically. Tests are run to validate the addon's functionality. The test results are logged and committed back to the repository for future reference. Proper permissions must be set to allow GitHub Actions to commit changes, and the path structure should be followed to ensure correct file access during the CI process.

chaitanyarora commented 2 months ago

CI/CD Pipeline for animation-tool addon

This documentation provides a guide on how to use and tweak particular settings for the animation-tool blender plugin.

1. Workflow Trigger

The GitHub Actions workflow is triggered by specific events such as:

These events automatically activate the pipeline to ensure the latest code is validated and tested.

2. Path Structure

When the pipeline is triggered, the contents of your repository are stored under the following path:

/home/runner/work/name_of_your_repo/name_of_your_repo

This is where you can access the repository files within the CI/CD environment.

chaitanyarora commented 2 months ago

GitHub Workflow CI/CD Pipeline for "Animation-Tool" Blender Addon

This document provides a guide to the GitHub Actions CI/CD pipeline used for the Animation-Tool Blender addon project. The pipeline automates the installation of dependencies, testing, and log management.

1. Workflow Trigger

The GitHub Actions workflow is triggered by specific events such as:

These events automatically activate the pipeline to ensure the latest code is validated and tested.

2. Path Structure

When the pipeline is triggered, the contents of your repository are stored under the following path:

/home/runner/work/name_of_your_repo/name_of_your_repo

This is where you can access the repository files within the CI/CD environment. All further steps in the workflow will reference this path for file access and modifications.

3. Dependency Management

Our Blender addon, Animation-Tool, depends on an external Python package, scipy. As a result, the pipeline installs scipy using Blender's Python environment.

Step for Installing Dependencies:

- name: Install SciPy (Blender's Python)
  run: |
    blender --background --python-expr "import sys; sys.executable"
    $BLENDER_PYTHON_EXECUTABLE -m ensurepip
    $BLENDER_PYTHON_EXECUTABLE -m pip install scipy

This ensures that the scipy package is installed within the Blender runtime environment, which will be used for running and testing the addon.

4. Running Tests

We execute tests on the addon to ensure functionality using Python scripts. These tests are stored in .py files, which are created and executed during the pipeline. Here is an example step for running the tests:

- name: Run Addon Tests
  run: |
    blender --background --python test_addon.py

In this example, test_addon.py contains the necessary test cases to verify the functionality of the addon.

5. Log File Creation and Updates

After running the tests, the output is written to a log file. This file is created or updated within the repository itself to track the test results.

Example of Log File Update:

- name: Write Test Results to Log
  run: |
    echo "Test Results: $(date)" >> test_results_log.txt
    echo "-------------------------" >> test_results_log.txt
    blender --background --python test_addon.py >> test_results_log.txt

The log file (test_results_log.txt) is updated on the cloud and provides a persistent record of the test results.

6. Committing Log Changes

Because the log file is updated on the cloud, the changes need to be committed back to the repository. This requires setting up permissions to allow the CI workflow to push commits to the repository. The user pushing the code must have permission to commit changes on the branch.

Commit Log Changes:

- name: Commit and Push Log Changes
  run: |
    git config --global user.email "actions@github.com"
    git config --global user.name "GitHub Actions"
    git add test_results_log.txt
    git commit -m "Update test log with latest results"
    git push
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

7. Permissions for Commit

For the workflow to push changes to the repository, certain permissions need to be enabled. The following permissions should be granted to ensure the workflow can commit to the branch:

Make sure the Write Permissions and Commit Changes options are enabled for the GitHub Actions workflow. The user who triggers the workflow must also have write access to the branch where the changes are being pushed.


chaitanyarora commented 2 months ago

GitHub Workflow CI/CD Pipeline for "Animation-Tool" Blender Addon

This document provides a guide to the GitHub Actions CI/CD pipeline used for our animation-tool Blender addon project.

1. Workflow Trigger

The GitHub Actions workflow is triggered by specific events such as:

These events automatically activate the pipeline to ensure the latest code is validated and tested.

2. Path Structure

When the pipeline is triggered, the contents of your repository are stored under the following path:

/home/runner/work/name_of_your_repo/name_of_your_repo

This is where you can access the repository files within the CI/CD environment.

3. Dependency Management

Our Blender addon, Animation-Tool, depends on an external Python package, scipy. As a result, the pipeline installs scipy using Blender's Python environment.

Step for Installing Dependencies:

- name: Install Python Scipy
        run: |

          blender-4.2.0-linux-x64/4.2/python/bin/python3.11 -m pip install --target "blender-4.2.0-linux-x64/4.2/python/lib/python3.11/site-packages/" scipy

This ensures that the scipy package is installed within the Blender runtime environment, which will be used for running and testing the addon.

4. Running Tests

We execute tests on the addon to ensure functionality using Python scripts. These tests are stored in .py files, which are created and executed during the pipeline. Here is an example step for running the tests:

blender-4.2.0-linux-x64/blender  --background --python-expr "
          import bpy
          bpy.ops.preferences.addon_install(filepath='/home/runner/work/github-trial/github-trial/animation_tool.zip')
          "

In this example, test_addon.py contains the necessary test cases to verify the functionality of the addon.

5. Log File Creation and Updates

After running the tests, the output is written to a log file. This file is created or updated within the repository itself to track the test results.

Example of Log File Update:

- name: Write Test Results to Log
  run: |
     git config --global user.email "useremail@gmail.com"
     git config --global user.name "username"
     git add .

The log file (.txt) is updated on the cloud and provides a persistent record of the test results.

6. Permissions for Commit

For the workflow to push changes to the repository, certain permissions need to be enabled. The following permissions should be granted to ensure the workflow can commit to the branch:

Make sure the Write Permissions and Commit Changes options are enabled for the GitHub Actions workflow. The user who triggers the workflow must also have write access to the branch where the changes are being pushed.