Skip to content

Commit

Permalink
Outline linux-py-x64
Browse files Browse the repository at this point in the history
  • Loading branch information
romainthomas committed Nov 9, 2023
1 parent be2be83 commit 874b4c2
Showing 1 changed file with 37 additions and 26 deletions.
63 changes: 37 additions & 26 deletions .github/workflows/linux-x86-64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,18 @@ jobs:
python -m pip install \
-r tests/requirements.txt \
-r api/python/build-requirements.txt
- name: Prepare test samples
shell: bash
run: |
source ${LIEF_VENV}/bin/activate
mkdir -p ${LIEF_SAMPLES_DIR}
python tests/dl_samples.py ${LIEF_SAMPLES_DIR}
- name: Build & install LIEF
shell: bash
run: |
source ${LIEF_VENV}/bin/activate
export PYLIEF_CONF="${GITHUB_WORKSPACE}/scripts/docker/config/pylinux-test-x64.toml"
python -m pip -vvv install api/python
- name: Prepare test samples
shell: bash
run: |
source ${LIEF_VENV}/bin/activate
mkdir -p ${LIEF_SAMPLES_DIR}
python tests/dl_samples.py ${LIEF_SAMPLES_DIR}
- name: Run tests
timeout-minutes: 5
shell: bash
Expand Down Expand Up @@ -154,6 +154,18 @@ jobs:
pywheels:
runs-on: ubuntu-latest
needs: linux-sdk
container:
image: liefproject/manylinux_2_28_x86_64
env:
CCACHE_DIR: "/home/pylief/.ccache"
CXXFLAGS: "-ffunction-sections -fdata-sections -fvisibility-inlines-hidden -static-libgcc"
CFLAGS: "-ffunction-sections -fdata-sections -static-libgcc"
LDFLAGS: "-Wl,--gc-sections -Wl,--exclude-libs,ALL"
LIEF_BUILD_DIR: "/tmp/lief-build"
ACTIONS_RUNTIME_URL: "${{ env.ACTIONS_RUNTIME_URL }}"
ACTIONS_RUNTIME_TOKEN: "${{ env.ACTIONS_RUNTIME_TOKEN }}"
ACTIONS_CACHE_URL: "${{ env.ACTIONS_CACHE_URL }}"
options: --user 1001:1001
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
Expand All @@ -166,41 +178,40 @@ jobs:
run: |
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
shell: bash
- name: Prepare ccache
shell: bash
run: |
mkdir -p /home/pylief/.ccache/tmp
- name: ccache cache files
uses: actions/cache@v3
with:
path: ~/.ccache
path: /home/pylief/.ccache
key: linux-x86-64-${{ runner.os }}-${{ matrix.python-version }}-${{ steps.get-date.outputs.date }}
restore-keys: |
linux-x86-64-${{ runner.os }}-${{ matrix.python-version }}
- name: Download LIEF install dir
uses: actions/download-artifact@v3
with:
name: linux-x86-64-install
path: ${{ runner.temp }}/lief-install
- name: Python ${{ matrix.python-version }} -- Wheel
shell: bash
path: /install
- name: Generate wheel
env:
PYTHON_VERSION: ${{ matrix.python-version }}
shell: bash
run: |
export PYLIEF_CONF=$GITHUB_WORKSPACE/scripts/docker/config/pylinux-x64.toml
PYTHON_VERSION_ALT=$(echo "${PYTHON_VERSION}" | sed 's/\.//') # Transform 3.8 -> 38
PYTHON_BINARY=/opt/python/cp${PYTHON_VERSION_ALT}-cp${PYTHON_VERSION_ALT}/bin/python${PYTHON_VERSION}
mkdir -p $HOME/.ccache
chmod -R 777 $HOME/.ccache
docker run --rm -u 1001:1001 \
-e CCACHE_COMPRESS=1 \
-e CCACHE_MAXSIZE=10.0G \
-e CCACHE_CPP2=1 \
-e CCACHE_DIR=/ccache \
-e PYTHON_VERSION=$PYTHON_VERSION_ALT \
-e PYTHON_BINARY=$PYTHON_BINARY \
-v $GITHUB_WORKSPACE:/src \
-v $HOME/.ccache:/ccache \
-v $RUNNER_TEMP/lief-install:/install \
liefproject/manylinux_2_28_x86_64 \
bash /src/scripts/docker/linux-py-x64
$PYTHON_BINARY -m pip -vvv wheel --disable-pip-version-check \
--wheel-dir=$GITHUB_WORKSPACE/wheel_stage \
$GITHUB_WORKSPACE/api/python
- name: Run auditwheel
shell: bash
run: |
ls -alh $GITHUB_WORKSPACE/wheel_stage
find $GITHUB_WORKSPACE/wheel_stage -exec \
auditwheel repair -w $GITHUB_WORKSPACE/dist {} \;
ls -alh $GITHUB_WORKSPACE/dist
- name: 'Artifact'
uses: actions/upload-artifact@v3
with:
Expand Down

0 comments on commit 874b4c2

Please sign in to comment.