mirror of
				https://github.com/b4tman/sync_ics2gcal
				synced 2025-11-04 12:38:32 +00:00 
			
		
		
		
	use poetry in ci
This commit is contained in:
		
							
								
								
									
										32
									
								
								.github/workflows/pythonpackage.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										32
									
								
								.github/workflows/pythonpackage.yml
									
									
									
									
										vendored
									
									
								
							@@ -13,30 +13,36 @@ on:
 | 
				
			|||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
  build:
 | 
					  build:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    runs-on: ubuntu-18.04
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
    strategy:
 | 
					    strategy:
 | 
				
			||||||
      max-parallel: 4
 | 
					      max-parallel: 4
 | 
				
			||||||
      matrix:
 | 
					      matrix:
 | 
				
			||||||
        python-version: [3.6, 3.7, 3.8, 3.9]
 | 
					        python-version: [3.6, 3.7, 3.8, 3.9]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - uses: actions/checkout@v1
 | 
					    - uses: actions/checkout@v2
 | 
				
			||||||
    - name: Set up Python ${{ matrix.python-version }}
 | 
					    - name: Set up Python ${{ matrix.python-version }}
 | 
				
			||||||
      uses: actions/setup-python@v1
 | 
					      uses: actions/setup-python@v2
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        python-version: ${{ matrix.python-version }}
 | 
					        python-version: ${{ matrix.python-version }}
 | 
				
			||||||
    - name: Install dependencies
 | 
					    - name: Upgrade pip
 | 
				
			||||||
      run: |
 | 
					      run: python -m pip install --upgrade pip
 | 
				
			||||||
        python -m pip install --upgrade pip
 | 
					    - name: Load cached Poetry installation
 | 
				
			||||||
        pip install -r requirements.txt
 | 
					      uses: actions/cache@v2
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        path: ~/.local
 | 
				
			||||||
 | 
					        key: poetry-0
 | 
				
			||||||
 | 
					    - name: Install Poetry
 | 
				
			||||||
 | 
					      uses: snok/install-poetry@v1
 | 
				
			||||||
 | 
					    - name: Install deps
 | 
				
			||||||
 | 
					      run: poetry install
 | 
				
			||||||
 | 
					    - name: Install deps form requirements.txt
 | 
				
			||||||
 | 
					      run: poetry run pip install -r requirements.txt
 | 
				
			||||||
    - name: Lint with flake8
 | 
					    - name: Lint with flake8
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        pip install flake8
 | 
					 | 
				
			||||||
        # stop the build if there are Python syntax errors or undefined names
 | 
					        # stop the build if there are Python syntax errors or undefined names
 | 
				
			||||||
        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
 | 
					        poetry run flake8 sync_ics2gcal --count --select=E9,F63,F7,F82 --show-source --statistics
 | 
				
			||||||
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
 | 
					        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
 | 
				
			||||||
        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
 | 
					        poetry run flake8 sync_ics2gcal --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
 | 
				
			||||||
    - name: Test with pytest
 | 
					    - name: Test with pytest
 | 
				
			||||||
      run: |
 | 
					      run: poetry run pytest -v
 | 
				
			||||||
        pip install pytest
 | 
					 | 
				
			||||||
        pytest -v
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										28
									
								
								.github/workflows/pythonpublish.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										28
									
								
								.github/workflows/pythonpublish.yml
									
									
									
									
										vendored
									
									
								
							@@ -10,17 +10,25 @@ jobs:
 | 
				
			|||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - uses: actions/checkout@v2
 | 
					    - uses: actions/checkout@v2
 | 
				
			||||||
    - name: Set up Python
 | 
					    - name: Set up Python
 | 
				
			||||||
      uses: actions/setup-python@v1
 | 
					      uses: actions/setup-python@v2
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        python-version: '3.x'
 | 
					        python-version: '3.x'
 | 
				
			||||||
    - name: Install dependencies
 | 
					    - name: Upgrade pip
 | 
				
			||||||
      run: |
 | 
					      run: python -m pip install --upgrade pip
 | 
				
			||||||
        python -m pip install --upgrade pip
 | 
					    - name: Load cached Poetry installation
 | 
				
			||||||
        pip install setuptools setuptools_scm setuptools_scm_git_archive wheel twine
 | 
					      uses: actions/cache@v2
 | 
				
			||||||
    - name: Build and publish
 | 
					      with:
 | 
				
			||||||
 | 
					        path: ~/.local
 | 
				
			||||||
 | 
					        key: poetry-0
 | 
				
			||||||
 | 
					    - name: Install Poetry
 | 
				
			||||||
 | 
					      uses: snok/install-poetry@v1
 | 
				
			||||||
 | 
					    - name: Install deps
 | 
				
			||||||
 | 
					      run: poetry install
 | 
				
			||||||
 | 
					    - name: Build
 | 
				
			||||||
 | 
					      run: poetry build
 | 
				
			||||||
 | 
					    - name: Publish
 | 
				
			||||||
      env:
 | 
					      env:
 | 
				
			||||||
        TWINE_USERNAME: __token__
 | 
					        REPO_USERNAME: __token__
 | 
				
			||||||
        TWINE_PASSWORD: ${{ secrets.pypi_token }}
 | 
					        REPO_PASSWORD: ${{ secrets.pypi_token }}
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        python setup.py sdist bdist_wheel
 | 
					        poetry publish -n -u $REPO_USERNAME -p $REPO_PASSWORD
 | 
				
			||||||
        twine upload dist/*
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										11
									
								
								.travis.yml
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								.travis.yml
									
									
									
									
									
								
							@@ -6,5 +6,14 @@ python:
 | 
				
			|||||||
  - "3.8"
 | 
					  - "3.8"
 | 
				
			||||||
  - "3.9"
 | 
					  - "3.9"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					before_install:
 | 
				
			||||||
 | 
					- pip install poetry
 | 
				
			||||||
 | 
					install:
 | 
				
			||||||
 | 
					- poetry install
 | 
				
			||||||
script:
 | 
					script:
 | 
				
			||||||
  - pytest -v
 | 
					# stop the build if there are Python syntax errors or undefined names
 | 
				
			||||||
 | 
					- poetry run flake8 sync_ics2gcal --count --select=E9,F63,F7,F82 --show-source --statistics
 | 
				
			||||||
 | 
					# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
 | 
				
			||||||
 | 
					- poetry run flake8 sync_ics2gcal --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
 | 
				
			||||||
 | 
					# run tests
 | 
				
			||||||
 | 
					- poetry run pytest -v
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user