forked from xmlsec/python-xmlsec
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (70 loc) · 3.39 KB
/
install_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: 'Check installable'
on:
push:
branches: [ gisce ]
pull_request:
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-22.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: Install Python 2 on ubuntu latest
if: matrix.python-version == '2.7.18' && matrix.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y build-essential libssl-dev libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev wget curl
wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz
tar -xzf Python-2.7.18.tgz
cd Python-2.7.18
./configure --enable-optimizations
make -j$(nproc)
sudo make altinstall
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2.7 get-pip.py
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
printf '1\n' | sudo update-alternatives --config python
cd ..
rm -rf Python-2.7.18 Python-2.7.18.tgz get-pip.py
- 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 .