Merge remote-tracking branch 'origin/main'

# Conflicts:
#	tests/utils/forge.py
This commit is contained in:
Aurelien Vaillant
2022-03-29 17:48:32 +02:00
4 changed files with 28 additions and 1 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ jobs:
- name: Commit the previous update
uses: actions-js/push@v1.3
if: ${{ inputs.draft_version == false }}
if: ${{ inputs.draft_version == 'false' }}
with:
github_token: ${{secrets.GITHUB_TOKEN}}
author_name: Moderlab
+3
View File
@@ -1,3 +1,6 @@
![Python](https://img.shields.io/badge/python-3.9-sucess)
![Blender](https://img.shields.io/badge/blender-3.0.0-sucess)
# Blender Addon
Template repository about blender addon. To used-it, clone this repository and rename the folder "blender_addon_folder" with your addon name.
Update the file "tests/main.py", line 29, set your addon name.
+14
View File
@@ -6,6 +6,7 @@ from pathlib import PurePosixPath
from docker.errors import DockerException
from .issue import ContainerErrorTest
from .properties import ContainerObject
from .misc import read_token
class VirtualMachine:
@@ -14,7 +15,9 @@ class VirtualMachine:
self.container = container
self.base_command = self.container.commands
self.clear_containers()
self.pull_image()
@staticmethod
def start_docker():
@@ -27,6 +30,17 @@ class VirtualMachine:
print('Docker isn\'t start or installed')
exit(1)
def pull_image(self):
"""Pull docker image"""
print(f'Pull this image : {self.container.image}')
if 'unreal' in self.container.label:
unreal_token = read_token('token_unreal.txt')
self.client.login(registry='https://ghcr.io', username='stilobique', password=unreal_token)
print('Start to PULL image')
self.client.images.pull(f'{self.container.image}:{self.container.tag}')
print('Image is pull')
def clear_containers(self):
"""Look all docker containers, and remove-it if the task are used with the unit test."""
containers = self.client.containers.list(all=True)
+10
View File
@@ -4,6 +4,16 @@ import sys
import zipfile
from .issue import ArchiveFolderSourceNotFound
from pathlib import Path
def read_token(file: str = 'token.txt') -> str:
"""From tests folder, return a token string, in a dedicated file"""
token_file = Path(os.getcwd(), 'tests', file)
with open(token_file, 'r') as f:
token = f.read()
return token
def generate_archive(list_clean: list, name: str):