From 645a28a278323bedfeabd3fa7ddfd9ea23fa377a Mon Sep 17 00:00:00 2001 From: RalfG Date: Fri, 16 Feb 2024 14:47:22 +0100 Subject: [PATCH] Update CI to use pyproject.toml; add tests for more py versions; upgrade action versions --- .github/workflows/publish.yml | 39 ++++++++++++++++++----------------- .github/workflows/test.yml | 13 ++++++------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f388cc1..24f7a38 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,45 +8,46 @@ on: jobs: python-package: runs-on: ubuntu-latest + permissions: + id-token: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.8' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel flake8 twine + pip install build flake8 - name: Check for syntax errors run: | flake8 ./deeplc --count --select=E9,F63,F7,F82 --show-source --statistics - - name: Build and publish to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + - name: Build package run: | - python setup.py sdist bdist_wheel - twine upload dist/* + python -m build . --sdist --wheel + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 - name: Upload compiled wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: dist path: dist/*.whl + windows-installer: runs-on: windows-latest needs: python-package steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: '3.8' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install . gooey pyinstaller + pip install .[gui] pyinstaller - name: Install Inno Setup - uses: crazy-max/ghaction-chocolatey@v1 + uses: crazy-max/ghaction-chocolatey@v3 with: args: install innosetup -y --allow-unofficial --force - name: Run pyinstaller @@ -56,7 +57,7 @@ jobs: - name: Run Inno Setup run: ISCC.exe ./deeplc_innosetup.iss /DMyAppVersion=$(python setup.py --version) - name: Upload installer - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: dist path: dist/*.exe @@ -66,7 +67,7 @@ jobs: needs: [python-package, windows-installer] steps: - name: Download installer - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: dist path: dist @@ -85,20 +86,20 @@ jobs: runs-on: ubuntu-latest needs: python-package steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - id: latest_release uses: pozetroninc/github-action-get-latest-release@master with: owner: compomics repo: DeepLC - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push to ghcr.io - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: streamlit push: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ffc2927..88dee15 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,17 +8,16 @@ on: jobs: test: - runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.9", "3.10"] - os: [ubuntu-latest, windows-latest, macos-latest] + system: [["3.8", "windows-latest"], ["3.8", "macos-latest"], ["3.8", "ubuntu-latest"], ["3.9", "ubuntu-latest"], ["3.10", "ubuntu-latest"], ["3.11", "ubuntu-latest"]] + runs-on: ${{ matrix.system[1] }} steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.system[0] }} + uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.system[0] }} - name: Install dependencies run: | python -m pip install --upgrade pip