Skip to content

Commit

Permalink
Enabled test_base in CI workflow
Browse files Browse the repository at this point in the history
Enabled artifact zipping and uploading

Simplified artifact naming in CI workflow

Switched CI tests to Linux

Updated CI workflow to run on Ubuntu

Updated CI workflow to run tests

Updated unit test script permissions and cleanup

Updated paths for Blender and Python executables

Updated CI workflow and test script

The CI workflow now runs on Ubuntu 20.04 instead of the latest version. The unit test script has been simplified by removing the steps to download and unzip Blender, as we are now using the Blender installed in Ubuntu. This change also includes updating the path to the Blender executable accordingly.

Refactor unittest script for cleaner error handling

Simplified unit test script

Updated Python version in CI workflow

Updated CI workflow setup

Updated Python3 installation command

Update typed-ast version

Removed 'typed-ast' from dev requirements

Updated CI workflow to include Blender

Updated CI workflow dependencies

The CI workflow has been updated to install operating system dependencies. The change specifically targets the installation of Python3 and Blender.

Repositioned OS dependencies installation

Refactor CI workflow

Updated unit test script path

Updated unit test script path

Updated unit test script for cross-platform compatibility

The unit test script has been updated to support both MacOS and Linux. The changes include:
- Checking the operating system before downloading Blender
- Downloading and extracting the appropriate version of Blender based on the OS
- Adjusted path setting for Blender executable depending on the OS
- Added new Python packages for testing: unittest2 and xmlrunner

Refactored script directory references

Updated unit test script

Updated CI environment and test dependencies

Simplified unit test script

Temporarily disable unit tests in CI
  • Loading branch information
fire committed Jun 21, 2024
1 parent 974af69 commit 59c7569
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 169 deletions.
115 changes: 28 additions & 87 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,11 @@ env:

jobs:
pre_release:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -47,86 +39,35 @@ jobs:
# sphinx-build -b html docs docs/_build/html
# rm -rf docs/_build/doctree

# - name: Zip files
# run: |
# cp CHANGELOG.md README.md LICENSE mixer/
# rm -rf mixer/blender_data/tests/

# - name: Upload artifacts
# uses: actions/upload-artifact@v2
# with:
# name: "${{ github.repository }}_${{ github.ref_name }}_${{ github.sha }}"
# path: |
# docs/_build
# mixer

# release:
# needs: pre_release
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/v')

# steps:
# - uses: actions/checkout@v2

# - name: Set up Python 3.8
# uses: actions/setup-python@v2
# with:
# python-version: 3.8

# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install requests

# - name: Download artifacts
# uses: actions/download-artifact@v2
# with:
# name: "${{ github.repository }}_${{ github.ref_name }}_${{ github.sha }}"
# path: .

# - name: Create release
# run: |
# rm -rf mixer/blender_data/tests/
# python -m zipfile -c mixer-${{ github.ref_name }}.zip mixer/
# # You'll need to replace the following line with your own script or action for creating a release
# # python -m gitlab.release mixer-${{ github.ref_name }}.zip

# - name: Upload release asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./mixer-${{ github.ref_name }}.zip
# asset_name: mixer-${{ github.ref_name }}.zip
# asset_content_type: application/zip

# test_base:
# needs: pre_release
# runs-on: windows-latest
# strategy:
# matrix:
# blender-version: ["2.92", "2.83", "2.93.beta", "3.0.alpha"]
- name: Zip files
run: |
cp CHANGELOG.md README.md LICENSE mixer/
rm -rf mixer/blender_data/tests/
# steps:
# - uses: actions/checkout@v2
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: "${{ github.ref_name }}_${{ github.sha }}"
path: |
docs/_build
mixer
# - name: Set up Python 3.8
# uses: actions/setup-python@v2
# with:
# python-version: 3.8
- name: Install operating system dependencies
run: |
sudo apt install -y python3 blender
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install requests
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
# - name: Download artifacts
# uses: actions/download-artifact@v2
# with:
# name: "${{ github.repository }}_${{ github.ref_name }}_${{ github.sha }}"
# path: .
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: "${{ github.ref_name }}_${{ github.sha }}"
path: .

# - name: Run tests
# run: |
# gitlab\run_unittest.bat
# - name: Run tests
# run: |
# chmod +x gitlab/run_unittest.sh
# ./gitlab/run_unittest.sh
81 changes: 0 additions & 81 deletions gitlab/run_unittest.bat

This file was deleted.

27 changes: 27 additions & 0 deletions gitlab/run_unittest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -e

# Get the absolute path of the current script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# create local folders if required
mkdir -p $SCRIPT_DIR/blender/cache

# remove old blender install if it exists
rm -rf $SCRIPT_DIR/blender/$MIXER_BLENDER_ZIP_BASENAME

# create config folder to isolate blender from user environment
mkdir -p $SCRIPT_DIR/blender/$MIXER_BLENDER_ZIP_BASENAME/$MIXER_BLENDER_VERSION_BASE/config

# install Mixer in local blender
blender --background --python $SCRIPT_DIR/install_mixer.py

# These tests run within blender
python3 -m pip install unittest-xml-reporting parameterized unittest2 xmlrunner --break-system-packages

blender --background --python-exit-code 1 --python $SCRIPT_DIR/../mixer/blender_data/tests/ci.py

# These tests launch 2 blender that communicate together
python3 -m xmlrunner discover --verbose tests.vrtist -o $MIXER_TEST_OUTPUT
python3 -m xmlrunner discover --verbose tests.broadcaster -o $MIXER_TEST_OUTPUT
python3 -m xmlrunner discover --verbose tests.blender -o $MIXER_TEST_OUTPUT
1 change: 0 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ requests==2.23.0
Sphinx==3.5.1
sphinx-rtd-theme==0.5.1
toml==0.10.1
typed-ast==1.4.1
typing==3.7.4.1
typing-extensions==3.7.4.2
unittest-xml-reporting==3.0.2
Expand Down

0 comments on commit 59c7569

Please sign in to comment.