From 24f309a3fcf3013a4965c86d6ba22c9a8d151389 Mon Sep 17 00:00:00 2001 From: Eriq Augustine Date: Tue, 6 Aug 2024 10:07:12 +0900 Subject: [PATCH] Updated the CI to include version checking and a placeholder for deployment. --- .ci/run.sh | 28 ----------------------- .github/workflows/main.yml | 47 +++++++++++++++++++++++++++++++++----- requirements.txt | 6 +++++ 3 files changed, 47 insertions(+), 34 deletions(-) delete mode 100755 .ci/run.sh diff --git a/.ci/run.sh b/.ci/run.sh deleted file mode 100755 index 3d622581..00000000 --- a/.ci/run.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -readonly THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -readonly BASE_DIR="${THIS_DIR}/.." - -function main() { - if [[ $# -ne 0 ]]; then - echo "USAGE: $0" - exit 1 - fi - - trap exit SIGINT - - local error_count=0 - - python "${BASE_DIR}/run_tests.py" - ((error_count += $?)) - - if [[ ${error_count} -gt 0 ]] ; then - echo "Found ${error_count} issues." - else - echo "No issues found." - fi - - return ${error_count} -} - -[[ "${BASH_SOURCE[0]}" == "${0}" ]] && main "$@" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e72867a..b94801a2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,8 +15,8 @@ jobs: strategy: matrix: - os: ['ubuntu-20.04', 'ubuntu-22.04', 'macos-11', 'macos-12', 'windows-2022'] - python-version: ['3.7', '3.8', '3.9', '3.10', 3.11] + os: ['ubuntu-20.04', 'ubuntu-22.04', 'macos-12', 'macos-13', 'windows-2019', 'windows-2022'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] runs-on: ${{ matrix.os }} @@ -35,10 +35,45 @@ jobs: path: ${{ env.pythonLocation }} key: ${{ runner.os }}-${{matrix.os}}-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }} - - name: Python Dependencies - run: | - pip3 install -r requirements.txt + - name: Install Dependencies + shell: bash + run: pip3 install -U -r requirements.txt + + - name: Check Python Version Compatibility + shell: bash + run: vermin --no-tips --no-parse-comments --target=3.7- --violations pacai - name: Run Tests shell: bash - run: ./.ci/run.sh + run: ./run_tests.py + + deploy-docs: + needs: [main] + if: ${{ github.event_name == 'push' && github.repository_owner == 'linqs' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }} + + # We will only run on one config, but using the matrix allows us to use the exact same steps. + strategy: + matrix: + os: ['ubuntu-22.04'] + python-version: ['3.10'] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Cache Python Dependencies + uses: actions/cache@v4 + with: + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-${{matrix.os}}-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('requirements.txt') }} + + - name: Install Dependencies + shell: bash + run: pip3 install -U -r requirements.txt diff --git a/requirements.txt b/requirements.txt index 6eccd1da..1196fb05 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,8 @@ Pillow>=8.3.2 + +setuptools +build +twine +packaging>=21.3 pdoc3>=0.7.0 +vermin