提交 c80772a1 编写于 作者: N nicolargo

Replace Travis by Github action #1850

上级 a0f24a3b
# Executed on every push by GitHub Actions.
# This runs CI tests
name: wheels
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.git,./glances/outputs/static
- name: Build manylinux Python wheels
uses: RalfG/python-wheels-manylinux-build@v0.3.3-manylinux2010_x86_64
with:
python-versions: 'cp36-cp36m cp37-cp37m'
# build-requirements: 'cython'
system-packages: 'python-devel'
# pre-build-command: 'sh pre-build-script.sh'
pip-wheel-args: '-w ./dist --no-deps'
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist
......@@ -83,3 +83,39 @@ jobs:
platforms: ${{env.DOCKER_PLATFORMS}}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
pypi:
runs-on: ubuntu-latest
steps:
- name: Install pip
if: github.event_name == 'push'
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
if: github.event_name == 'push'
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution package to Test PyPI
if: github.event_name == 'push'
uses: pypa/gh-action-pypi-publish@master
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_API_TOKEN }}
\ No newline at end of file
name: test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# Stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.git,./glances/outputs/static
# 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 --exclude=.git,./glances/outputs/static
- name: Unitary tests
run: |
python ./unitest.py
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册