Open chaitanyarora opened 2 months ago
This documentation provides a guide on how to use and tweak particular settings for the animation-tool blender plugin.
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.
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.
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.
The GitHub Actions workflow is triggered by specific events such as:
main
, dev
).These events automatically activate the pipeline to ensure the latest code is validated and tested.
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.
Our Blender addon, Animation-Tool, depends on an external Python package, scipy
. As a result, the pipeline installs scipy
using Blender's Python environment.
- 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.
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.
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.
- 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.
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.
- 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 }}
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.
This document provides a guide to the GitHub Actions CI/CD pipeline used for our animation-tool Blender addon project.
The GitHub Actions workflow is triggered by specific events such as:
main
, dev
).These events automatically activate the pipeline to ensure the latest code is validated and tested.
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.
Our Blender addon, Animation-Tool, depends on an external Python package, scipy
. As a result, the pipeline installs scipy
using Blender's Python environment.
- 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.
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.
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.
- 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.
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.
### 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.
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.
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.
Step for Installing Dependencies: yaml Copy code
yaml Copy code
Example of Log File Update: yaml Copy code
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.