mirror of
				https://github.com/ae-utbm/sith.git
				synced 2025-11-03 18:43:04 +00:00 
			
		
		
		
	Initial unit testing action
This commit is contained in:
		
							
								
								
									
										61
									
								
								.github/workflows/unittests.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										61
									
								
								.github/workflows/unittests.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,61 @@
 | 
				
			|||||||
 | 
					name: Unit Testing Action
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on: [push]
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  unittest:
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - uses: actions/checkout@v3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up python
 | 
				
			||||||
 | 
					        uses: actions/setup-python@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          python-version: '3.8'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Install dependencies
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          apt-get update
 | 
				
			||||||
 | 
					          apt-get install gettext libxapian-dev libgraphviz-dev
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Install poetry
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          python -m install --upgrade pip
 | 
				
			||||||
 | 
					          python -m pip install poetry
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Checking pyproject.toml syntax
 | 
				
			||||||
 | 
					        run: poetry check
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Install project
 | 
				
			||||||
 | 
					        run: poetry install -E testing
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Setup xapian index
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          mkdir -p /dev/shm/search_indexes
 | 
				
			||||||
 | 
					          ln -s /dev/shm/search_indexes sith/search_indexes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Setup project
 | 
				
			||||||
 | 
					        run: poetry run ./manage.py compilemessages
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
 | 
					      - name: Launch tests and generate coverage report
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          poetry run coverage run ./manage.py test
 | 
				
			||||||
 | 
					          poetry run coverage report
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
 | 
					  lint:
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - uses: actions/checkout@v3
 | 
				
			||||||
 | 
					      - name: Set up python
 | 
				
			||||||
 | 
					        uses: actions/setup-python@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          python-version: '3.8'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Install black
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          python -m install --upgrade pip
 | 
				
			||||||
 | 
					          python -m pip install black==22.6.0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Check linting
 | 
				
			||||||
 | 
					        run: black check .
 | 
				
			||||||
		Reference in New Issue
	
	Block a user