mirror of
				https://github.com/hiyouga/LLaMA-Factory.git
				synced 2025-11-04 18:02:19 +08:00 
			
		
		
		
	add ci
Former-commit-id: 3ea3acdadaa54abe33d93538580196cfdd91ee56
This commit is contained in:
		
							parent
							
								
									e0f2c0b5dc
								
							
						
					
					
						commit
						6d17c59090
					
				
							
								
								
									
										46
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										46
									
								
								.github/workflows/tests.yml
									
									
									
									
										vendored
									
									
								
							@ -2,28 +2,58 @@ name: tests
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  push:
 | 
			
		||||
    branches: [ "main" ]
 | 
			
		||||
    branches:
 | 
			
		||||
      - main
 | 
			
		||||
    paths:
 | 
			
		||||
      - "**.py"
 | 
			
		||||
      - "requirements.txt"
 | 
			
		||||
      - ".github/workflows/*.yml"
 | 
			
		||||
  pull_request:
 | 
			
		||||
    branches: [ "main" ]
 | 
			
		||||
    branches:
 | 
			
		||||
      - main
 | 
			
		||||
    paths:
 | 
			
		||||
      - "**.py"
 | 
			
		||||
      - "requirements.txt"
 | 
			
		||||
      - ".github/workflows/*.yml"
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  check_code_quality:
 | 
			
		||||
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
      - uses: actions/checkout@v4
 | 
			
		||||
 | 
			
		||||
      - name: Set up Python
 | 
			
		||||
        uses: actions/setup-python@v5
 | 
			
		||||
        with:
 | 
			
		||||
          python-version: "3.8"
 | 
			
		||||
 | 
			
		||||
          cache: "pip"
 | 
			
		||||
          cache-dependency-path: "setup.py"
 | 
			
		||||
      - name: Install dependencies
 | 
			
		||||
        run: |
 | 
			
		||||
          python -m pip install --upgrade pip
 | 
			
		||||
          python -m pip install ruff
 | 
			
		||||
 | 
			
		||||
          python -m pip install .[torch,metrics,quality]
 | 
			
		||||
      - name: Check quality
 | 
			
		||||
        run: |
 | 
			
		||||
            make style && make quality
 | 
			
		||||
 | 
			
		||||
  pytest:
 | 
			
		||||
    needs: check_code_quality
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        python-version: ["3.8", "3.9"]
 | 
			
		||||
        os: ["ubuntu-latest", "windows-latest"]
 | 
			
		||||
    runs-on: ${{ matrix.os }}
 | 
			
		||||
    steps:
 | 
			
		||||
      - uses: actions/checkout@v4
 | 
			
		||||
      - name: Set up Python ${{ matrix.python-version }}
 | 
			
		||||
        uses: actions/setup-python@v5
 | 
			
		||||
        with:
 | 
			
		||||
          python-version: ${{ matrix.python-version }}
 | 
			
		||||
          cache: "pip"
 | 
			
		||||
          cache-dependency-path: "setup.py"
 | 
			
		||||
      - name: Install dependencies
 | 
			
		||||
        run: |
 | 
			
		||||
          python -m pip install --upgrade pip
 | 
			
		||||
          python -m pip install .[torch,metrics,quality]
 | 
			
		||||
      - name: Test with pytest
 | 
			
		||||
        run: |
 | 
			
		||||
          make test
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user