From 7c0bfc679dc48d7591c39a8cc53b04790893559b Mon Sep 17 00:00:00 2001 From: Renata Date: Thu, 27 Jun 2024 19:41:52 -0400 Subject: [PATCH] test --- .github/workflows/ci.yml | 86 ++++++++++++------------ .github/workflows/deploy.yml | 124 ++++++++++++++++++----------------- 2 files changed, 106 insertions(+), 104 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f51bda4a..821d48bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,44 +1,44 @@ -# on: -# push: {} -# pull_request: -# types: [closed] -# release: -# types: [published] - -# jobs: - -# run-tests: -# runs-on: ubuntu-latest -# strategy: -# matrix: -# python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] -# steps: -# - uses: actions/checkout@v3 - -# - name: Set up Python ${{ matrix.python-version }} -# uses: actions/setup-python@v3 -# with: -# python-version: ${{ matrix.python-version }} - -# - name: Upgrade pip, setuptools, and wheel -# run: | -# pip install --upgrade pip setuptools wheel - -# - name: Install dependencies -# run: | -# sudo apt-get update -# sudo apt-get install libhdf5-serial-dev zlib1g-dev libatlas-base-dev lcov swig3.0 libpcsclite-dev -# mkdir -p ~/bin/ && ln -s /usr/bin/swig3.0 ~/bin/swig && export PATH=~/bin/:$PATH -# pip install wheel # Ensure wheel is installed -# pip install -e .[ci,test,yubikey] - -# - name: Setup GitHub user -# run: | -# git config --global user.name oll-bot -# git config --global user.email developers@openlawlib.org - -# - name: Run pre-commit and test with pytest -# run: | -# pre-commit run --all-files -# pytest taf/tests +on: + push: {} + pull_request: + types: [closed] + release: + types: [published] + +jobs: + + run-tests: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip, setuptools, and wheel + run: | + pip install --upgrade pip setuptools wheel + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install libhdf5-serial-dev zlib1g-dev libatlas-base-dev lcov swig3.0 libpcsclite-dev + mkdir -p ~/bin/ && ln -s /usr/bin/swig3.0 ~/bin/swig && export PATH=~/bin/:$PATH + pip install wheel # Ensure wheel is installed + pip install -e .[ci,test,yubikey] + + - name: Setup GitHub user + run: | + git config --global user.name oll-bot + git config --global user.email developers@openlawlib.org + + - name: Run pre-commit and test with pytest + run: | + pre-commit run --all-files + pytest taf/tests diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ec334d49..5da3acbd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,71 +9,73 @@ on: - '**' jobs: - # build_and_upload_wheel: - # strategy: - # matrix: - # # python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - # python-version: ['3.10'] - - # runs-on: ubuntu-latest - - # steps: - # - name: Checkout code - # uses: actions/checkout@v3 - - # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v3 - # with: - # python-version: ${{ matrix.python-version }} - - # - name: Set up Python - # uses: actions/setup-python@v3 - # with: - # python-version: ${{ matrix.python-version }} - - # - name: Upgrade pip - # run: | - # pip install --upgrade pip setuptools wheel - - # - name: Install swig - # run: | - # sudo apt-get update - # sudo apt-get install libhdf5-serial-dev zlib1g-dev libatlas-base-dev lcov swig3.0 libpcsclite-dev - # mkdir -p ~/bin/ && ln -s /usr/bin/swig3.0 ~/bin/swig && export PATH=~/bin/:$PATH - - # - name: Install and build TAF - # run: | - # pip install .[yubikey] - # python setup.py sdist bdist_wheel clean --all - - # - name: Install publishing dependencies - # run: | - # pip install packaging - # pip install twine==3.8.0 - - # - name: Upload to TestPyPi - # # if: startsWith(github.ref, 'refs/tags/v') - # run: | - # twine upload --repository-url https://test.pypi.org/legacy/ dist/* - # env: - # TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} - # TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} - - - # - name: Upload wheels to PyPI - # if: startsWith(github.ref, 'refs/tags/v') - # run: | - # python -m pip install twine - # twine check dist/* - # twine upload --skip-existing dist/* -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} - # env: - # PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} - # PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - # displayName: "Upload wheels" + build_and_upload_wheel: + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + + runs-on: ubuntu-latest + needs: run-tests + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade pip + run: | + pip install --upgrade pip setuptools wheel + + - name: Install swig + run: | + sudo apt-get update + sudo apt-get install libhdf5-serial-dev zlib1g-dev libatlas-base-dev lcov swig3.0 libpcsclite-dev + mkdir -p ~/bin/ && ln -s /usr/bin/swig3.0 ~/bin/swig && export PATH=~/bin/:$PATH + + - name: Install and build TAF + run: | + pip install .[yubikey] + python setup.py sdist bdist_wheel clean --all + + - name: Install publishing dependencies + run: | + pip install packaging + pip install twine==3.8.0 + + - name: Upload to TestPyPi + # if: startsWith(github.ref, 'refs/tags/v') + run: | + twine upload --repository-url https://test.pypi.org/legacy/ dist/* + env: + TWINE_USERNAME: ${{ secrets.TEST_PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} + + + - name: Upload wheels to PyPI + if: startsWith(github.ref, 'refs/tags/v') + run: | + python -m pip install twine + twine check dist/* + twine upload --skip-existing dist/* -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} + env: + PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + displayName: "Upload wheels" create_release: runs-on: ubuntu-latest + needs: build_and_upload_wheel + outputs: upload_url: ${{ steps.set_upload_url.outputs.upload_url }} steps: