mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 13:15:43 +00:00 
			
		
		
		
	merge mysql
This commit is contained in:
		
							
								
								
									
										66
									
								
								.github/workflows/mysql.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										66
									
								
								.github/workflows/mysql.yaml
									
									
									
									
										vendored
									
									
								
							| @@ -1,66 +0,0 @@ | |||||||
| # MySQL Unit Testing |  | ||||||
|  |  | ||||||
| name: MySQL |  | ||||||
|  |  | ||||||
| on: |  | ||||||
|   workflow_run: |  | ||||||
|     workflows: ['PR checks'] |  | ||||||
|     types: |  | ||||||
|       - completed |  | ||||||
|  |  | ||||||
| env: |  | ||||||
|   # Database backend configuration |  | ||||||
|   INVENTREE_DB_ENGINE: django.db.backends.mysql |  | ||||||
|   INVENTREE_DB_NAME: inventree |  | ||||||
|   INVENTREE_DB_USER: root |  | ||||||
|   INVENTREE_DB_PASSWORD: password |  | ||||||
|   INVENTREE_DB_HOST: '127.0.0.1' |  | ||||||
|   INVENTREE_DB_PORT: 3306 |  | ||||||
|   INVENTREE_DEBUG: info |  | ||||||
|   INVENTREE_MEDIA_ROOT: ./media |  | ||||||
|   INVENTREE_STATIC_ROOT: ./static |  | ||||||
|  |  | ||||||
|  |  | ||||||
| jobs: |  | ||||||
|  |  | ||||||
|   test: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     if: ${{ github.event.workflow_run.conclusion == 'success' }} |  | ||||||
|  |  | ||||||
|     services: |  | ||||||
|       mysql: |  | ||||||
|         image: mysql:latest |  | ||||||
|         env: |  | ||||||
|           MYSQL_ALLOW_EMPTY_PASSWORD: yes |  | ||||||
|           MYSQL_DATABASE: inventree |  | ||||||
|           MYSQL_USER: inventree |  | ||||||
|           MYSQL_PASSWORD: password |  | ||||||
|           MYSQL_ROOT_PASSWORD: password |  | ||||||
|         options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 |  | ||||||
|         ports: |  | ||||||
|           - 3306:3306 |  | ||||||
|  |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout Code |  | ||||||
|         uses: actions/checkout@v2 |  | ||||||
|       - name: Setup Python |  | ||||||
|         uses: actions/setup-python@v2 |  | ||||||
|         with: |  | ||||||
|           python-version: 3.7 |  | ||||||
|       - name: Install Dependencies |  | ||||||
|         run: | |  | ||||||
|           sudo apt-get install mysql-server libmysqlclient-dev |  | ||||||
|           pip3 install invoke |  | ||||||
|           pip3 install mysqlclient |  | ||||||
|           invoke install |  | ||||||
|       - name: Run Tests |  | ||||||
|         run: invoke test |  | ||||||
|       - name: Data Import Export |  | ||||||
|         run: | |  | ||||||
|           invoke migrate |  | ||||||
|           python3 ./InvenTree/manage.py flush --noinput |  | ||||||
|           invoke import-fixtures |  | ||||||
|           invoke export-records -f data.json |  | ||||||
|           python3 ./InvenTree/manage.py flush --noinput |  | ||||||
|           invoke import-records -f data.json |  | ||||||
|           invoke import-records -f data.json |  | ||||||
							
								
								
									
										50
									
								
								.github/workflows/pr_checks.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										50
									
								
								.github/workflows/pr_checks.yaml
									
									
									
									
										vendored
									
									
								
							| @@ -251,3 +251,53 @@ jobs: | |||||||
|           invoke import-records -f data.json |           invoke import-records -f data.json | ||||||
|           invoke import-records -f data.json |           invoke import-records -f data.json | ||||||
|  |  | ||||||
|  |   mysql: | ||||||
|  |     name: MySql | ||||||
|  |     needs: ['javascript', 'html'] | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     env: | ||||||
|  |       # Database backend configuration | ||||||
|  |       INVENTREE_DB_ENGINE: django.db.backends.mysql | ||||||
|  |       INVENTREE_DB_USER: root | ||||||
|  |       INVENTREE_DB_PASSWORD: password | ||||||
|  |       INVENTREE_DB_HOST: '127.0.0.1' | ||||||
|  |       INVENTREE_DB_PORT: 3306 | ||||||
|  |       INVENTREE_DEBUG: info | ||||||
|  |  | ||||||
|  |     services: | ||||||
|  |       mysql: | ||||||
|  |         image: mysql:latest | ||||||
|  |         env: | ||||||
|  |           MYSQL_ALLOW_EMPTY_PASSWORD: yes | ||||||
|  |           MYSQL_DATABASE: inventree | ||||||
|  |           MYSQL_USER: inventree | ||||||
|  |           MYSQL_PASSWORD: password | ||||||
|  |           MYSQL_ROOT_PASSWORD: password | ||||||
|  |         options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 | ||||||
|  |         ports: | ||||||
|  |           - 3306:3306 | ||||||
|  |  | ||||||
|  |     steps: | ||||||
|  |       - name: Checkout Code | ||||||
|  |         uses: actions/checkout@v2 | ||||||
|  |       - name: Setup Python | ||||||
|  |         uses: actions/setup-python@v2 | ||||||
|  |         with: | ||||||
|  |           python-version: 3.7 | ||||||
|  |       - name: Install Dependencies | ||||||
|  |         run: | | ||||||
|  |           sudo apt-get install mysql-server libmysqlclient-dev | ||||||
|  |           pip3 install invoke | ||||||
|  |           pip3 install mysqlclient | ||||||
|  |           invoke install | ||||||
|  |       - name: Run Tests | ||||||
|  |         run: invoke test | ||||||
|  |       - name: Data Import Export | ||||||
|  |         run: | | ||||||
|  |           invoke migrate | ||||||
|  |           python3 ./InvenTree/manage.py flush --noinput | ||||||
|  |           invoke import-fixtures | ||||||
|  |           invoke export-records -f data.json | ||||||
|  |           python3 ./InvenTree/manage.py flush --noinput | ||||||
|  |           invoke import-records -f data.json | ||||||
|  |           invoke import-records -f data.json | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user