From 085bf6a66ba0c917c59f830748e9933d670e786b Mon Sep 17 00:00:00 2001 From: PSala Date: Tue, 23 Jul 2024 12:32:03 +0200 Subject: [PATCH] New workflow intallable check py2/py3 ubuntu 20, 22 and latest --- .github/workflows/install_test.yml | 58 +++++++++++++++++++++++++++++ .github/workflows/macosx.yml | 44 ---------------------- .github/workflows/manylinux2010.yml | 37 ------------------ .github/workflows/sdist.yml | 26 ------------- 4 files changed, 58 insertions(+), 107 deletions(-) create mode 100644 .github/workflows/install_test.yml delete mode 100644 .github/workflows/macosx.yml delete mode 100644 .github/workflows/manylinux2010.yml delete mode 100644 .github/workflows/sdist.yml diff --git a/.github/workflows/install_test.yml b/.github/workflows/install_test.yml new file mode 100644 index 00000000..64ea7551 --- /dev/null +++ b/.github/workflows/install_test.yml @@ -0,0 +1,58 @@ +name: 'Check installable' + +on: + push: + branches: [ gisce ] + + +jobs: + check-package-installable: + strategy: + matrix: + python-version: [ "2.7.18", "3.11"] + os: [ ubuntu-latest, ubuntu-20.04, ubuntu-22.04 ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3 + if: matrix.python-version == '3.11' + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install Python 2 on ubuntu 20 + if: matrix.python-version == '2.7.18' && matrix.os == 'ubuntu-20.04' + run: | + sudo apt update + sudo apt install python2 python2-dev + curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py + sudo python2 get-pip.py + sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 + sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2 + printf '1\n' | sudo update-alternatives --config python + + - name: Install Python 2 on ubuntu >= 22 + if: matrix.python-version == '2.7.18' && matrix.os != 'ubuntu-20.04' + run: | + sudo add-apt-repository ppa:deadsnakes/ppa -y + sudo apt update + sudo apt install python2 python2-dev python-pip + sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 + sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2 + printf '1\n' | sudo update-alternatives --config python + cd /usr/bin + sudo ln -s /usr/bin/pip2 ./pip + + - name: Set up virtual environment + run: | + python -m pip install --upgrade pip + pip install virtualenv + python -m virtualenv venv + + - name: Install package + run: | + sudo apt-get install libxml2-dev libxmlsec1-dev libxmlsec1-openssl opensc softhsm2 libengine-pkcs11-openssl + source venv/bin/activate + pip install --upgrade pip setuptools wheel build + pip install -e . diff --git a/.github/workflows/macosx.yml b/.github/workflows/macosx.yml deleted file mode 100644 index c8bfee95..00000000 --- a/.github/workflows/macosx.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: MacOS -on: [push, pull_request] -jobs: - macosx: - runs-on: macos-latest - strategy: - matrix: - python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] - steps: - - uses: actions/checkout@v1 - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python }} - - name: Install build dependencies - run: | - pip install --upgrade pip setuptools wheel - brew install libxml2 libxmlsec1 pkg-config - - name: Build macosx_x86_64 wheel - run: | - python setup.py bdist_wheel - - name: Set environment variables - shell: bash - run: | - echo ::set-env name=PKGVER::$(python setup.py --version) - echo ::set-env name=LLVM_PROFILE_FILE::"pyxmlsec-%p.profraw" - - name: Install test dependencies - env: - CC: clang - CFLAGS: "-fprofile-instr-generate -fcoverage-mapping" - LDFLAGS: "-fprofile-instr-generate -fcoverage-mapping" - run: | - rm -rf build/ - pip install coverage --upgrade -r requirements-test.txt - pip install --editable . - - name: Run tests - run: | - coverage run -m pytest -v --color=yes - - name: Report coverage to codecov - run: | - LIBFILE=$(python -c "import xmlsec; print(xmlsec.__file__)") - /Library/Developer/CommandLineTools/usr/bin/llvm-profdata merge -sparse pyxmlsec-*.profraw -output pyxmlsec.profdata - /Library/Developer/CommandLineTools/usr/bin/llvm-cov show ${LIBFILE} -instr-profile=pyxmlsec.profdata src > coverage.txt - bash <(curl -s https://codecov.io/bash) -f coverage.txt diff --git a/.github/workflows/manylinux2010.yml b/.github/workflows/manylinux2010.yml deleted file mode 100644 index 637983d4..00000000 --- a/.github/workflows/manylinux2010.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: manylinux2010 -on: [push, pull_request] -jobs: - manylinux2010_x86_64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux2010_x86_64 - strategy: - matrix: - python-abi: [cp27-cp27m, cp27-cp27mu, cp35-cp35m, cp36-cp36m, cp37-cp37m, cp38-cp38, cp39-cp39] - steps: - - uses: actions/checkout@v1 - - name: Install build dependencies - run: | - /opt/python/${{ matrix.python-abi }}/bin/pip install --upgrade pip setuptools wheel - - name: Set environment variables - shell: bash - run: | - echo ::set-env name=PKGVER::$(/opt/python/${{ matrix.python-abi }}/bin/python setup.py --version) - - name: Build linux_x86_64 wheel - env: - PYXMLSEC_STATIC_DEPS: true - run: | - /opt/python/${{ matrix.python-abi }}/bin/python setup.py bdist_wheel - - name: Label manylinux2010_x86_64 wheel - run: | - ls -la dist/ - auditwheel show dist/xmlsec-${PKGVER}-${{ matrix.python-abi }}-linux_x86_64.whl - auditwheel repair dist/xmlsec-${PKGVER}-${{ matrix.python-abi }}-linux_x86_64.whl - ls -l wheelhouse/ - auditwheel show wheelhouse/xmlsec-${PKGVER}-${{ matrix.python-abi }}-manylinux2010_x86_64.whl - - name: Install test dependencies - run: | - /opt/python/${{ matrix.python-abi }}/bin/pip install --upgrade -r requirements-test.txt - /opt/python/${{ matrix.python-abi }}/bin/pip install xmlsec --only-binary=xmlsec --no-index --find-links=wheelhouse/ - - name: Run tests - run: | - /opt/python/${{ matrix.python-abi }}/bin/pytest -v --color=yes diff --git a/.github/workflows/sdist.yml b/.github/workflows/sdist.yml deleted file mode 100644 index 5b5dac96..00000000 --- a/.github/workflows/sdist.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: sdist -on: [push, pull_request] -jobs: - sdist: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up Python 3.9 - uses: actions/setup-python@v2 - with: - python-version: 3.9 - - name: Install build dependencies - run: | - pip install --upgrade pip setuptools wheel - - name: Package source dist - run: | - python setup.py sdist - - name: Install test dependencies - env: - PYXMLSEC_STATIC_DEPS: true - run: | - pip install --upgrade -r requirements-test.txt - pip install dist/xmlsec-$(python setup.py --version).tar.gz - - name: Run tests - run: | - pytest -v --color=yes