-
Notifications
You must be signed in to change notification settings - Fork 37
106 lines (82 loc) · 2.67 KB
/
build-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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Build and Test
# Run this workflow whenever a PR is created or pushed to.
on:
pull_request:
types: [opened, synchronize]
jobs:
build:
strategy:
matrix:
# It's undocumented, but matrix variable arrays can be maps, too!
# https://stackoverflow.com/a/68940067/119527
os:
- version: "ubuntu-20.04"
native-python: "3.8"
- version: "ubuntu-22.04"
native-python: "3.10"
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
fail-fast: False
name: "${{matrix.os.version}}: Python ${{matrix.python-version}}"
runs-on: ${{ matrix.os.version }}
env:
TEST_DOCKER_IMAGE: "centos:5"
steps:
- uses: actions/checkout@v3
# https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
- run: git fetch --prune --unshallow
# We use Python from deadsnakes/action because the Python from
# actions/setup-python links with RUNPATH which is not compatible
# with StaticX. See #224.
- name: Set up Python ${{ matrix.python-version }}
uses: deadsnakes/[email protected]
if: "(matrix.python-version != matrix.os.native-python)" # Already installed
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
sudo apt-get update
sudo apt-get install -y busybox musl-tools scons
docker pull $TEST_DOCKER_IMAGE
- name: List version info
run: |
echo "Installed version info:"
echo -e "\nPython:"
python --version
python -c "import sys; assert '.'.join(str(v) for v in sys.version_info[:2]) == sys.argv[1]" ${{ matrix.python-version }}
echo -e "\nPip:"
pip --version
echo -e "\nDocker:"
docker version
echo -e "\nGCC:"
gcc --version
echo -e "\nLD:"
ld --version
echo -e "\npatchelf:"
patchelf --version
- name: Build and install
run: |
python -m build
pip install dist/staticx-*-py3-none-manylinux1_x86_64.whl
staticx --version
# Make sure we only use the installed wheel
rm -r staticx bootloader
- name: Run unit tests
run: |
pytest -v
- name: Run integration tests
run: |
test/run_all.sh
- name: Run integration tests (w/o compression)
run: |
STATICX_FLAGS='--no-compress' test/run_all.sh
- name: Run integration tests (w/ strip)
run: |
STATICX_FLAGS='--strip' test/run_all.sh