Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
renatav committed Jun 27, 2024
1 parent e15f95e commit 7c0bfc6
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 104 deletions.
86 changes: 43 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
124 changes: 63 additions & 61 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7c0bfc6

Please sign in to comment.