Skip to content

Update github actions in CI #110

Update github actions in CI

Update github actions in CI #110

Workflow file for this run

name: CI
on:
push:
pull_request:
env:
winfsp_version: "1.12.22339"
jobs:
Quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin v4.1.7
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # pin v5.1.1
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # pin v3.0.1
Wheels:
name: Wheel for ${{ matrix.python_version }}-${{ matrix.architecture }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python_version: [cp39, cp310, cp311, cp312]
architecture: [win32, win_amd64]
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin v4.1.7
- name: Install winfsp
run: choco install winfsp -y --version=${{ env.winfsp_version }}
- name: Download winfsp-tests-x86
uses: engineerd/[email protected]
with:
name: winfsp-tests-x86.exe
url: https://github.com/winfsp/winfsp/releases/download/v${{ env.winfsp_version }}/winfsp-tests-${{ env.winfsp_version }}.zip
pathInArchive: winfsp-tests-x86.exe
- name: Run cibuildwheel for ${{ matrix.python_version }}-${{ matrix.architecture }}
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python_version }}-${{ matrix.architecture }}
CIBW_TEST_COMMAND: pytest --pyargs winfspy --doctest-modules --cov=winfspy --cov-report=xml:{project}/coverage.xml --cov-report=term -vvv --log-level INFO
CIBW_BEFORE_TEST: pip install -r requirements-test.txt
- name: Upload coverage report on codecov
uses: codecov/codecov-action@v1
env:
PYTHON_VERSION: ${{ matrix.architecture }}
ARCHITECTURE: ${{ matrix.python_version }}
with:
env_vars: PYTHON_VERSION, ARCHITECTURE
- name: Upload wheel as an artifact
uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl
Source:
name: Source distribution
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin v4.1.7
- name: Install winfsp
run: choco install winfsp -y --version=${{ env.winfsp_version }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12
- name: Build source distribution
run: python setup.py sdist
- name: Upload wheel as an artifact
uses: actions/upload-artifact@v2
with:
path: ./dist/*.tar.gz
Release:
runs-on: ubuntu-latest
needs: [Quality, Wheels, Source]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Download wheels and source distribution
uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- name: Publish on PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}