From 847cf9102eae0d601f41f4d5f604e46ca9a1e228 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Tue, 1 Mar 2022 17:51:25 +0100 Subject: [PATCH 1/4] Add badge --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index bee538a..db474c1 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,5 @@ +![Python](https://img.shields.io/badge/python-3.9-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. From 948b4077e6609f7ba2004df86266f01fab030e3a Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Tue, 1 Mar 2022 17:53:41 +0100 Subject: [PATCH 2/4] Add blender badge --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index db474c1..0a905c0 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,5 @@ ![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. From 72becd25387bbd21d5c476872ce4965cdb4116a6 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Wed, 2 Mar 2022 14:20:48 +0100 Subject: [PATCH 3/4] Add pull container image, token config --- tests/utils/container.py | 14 ++++++++++++++ tests/utils/forge.py | 11 +---------- tests/utils/misc.py | 10 ++++++++++ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/tests/utils/container.py b/tests/utils/container.py index c6189f7..056fb59 100644 --- a/tests/utils/container.py +++ b/tests/utils/container.py @@ -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) diff --git a/tests/utils/forge.py b/tests/utils/forge.py index d364ef1..19a111b 100644 --- a/tests/utils/forge.py +++ b/tests/utils/forge.py @@ -1,16 +1,7 @@ -import os import requests -from pathlib import Path from github import Github - - -def read_token(): - token_file = Path(os.getcwd(), 'tests', 'token.txt') - with open(token_file, 'r') as f: - token = f.read() - - return token +from misc import read_token def get_release_file(filename: str, repo: str, prerelease: bool = False): diff --git a/tests/utils/misc.py b/tests/utils/misc.py index fd7ba70..3fc4993 100644 --- a/tests/utils/misc.py +++ b/tests/utils/misc.py @@ -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): From 6c6072c2222d5e7227526a084f859aad61e71620 Mon Sep 17 00:00:00 2001 From: Aurelien Vaillant Date: Mon, 7 Mar 2022 17:18:11 +0100 Subject: [PATCH 4/4] Fix commit info about the package setup --- .github/workflows/package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 523e876..f6266b9 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -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