Fix endless loop #854
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Linux x86-64' | |
on: push | |
jobs: | |
linux-sdk: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get Date | |
id: get-date | |
run: | | |
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: ccache cache files | |
uses: actions/cache@v3 | |
with: | |
path: ~/.ccache | |
key: linux-x86-64-${{ runner.os }}-sdk-${{ steps.get-date.outputs.date }} | |
restore-keys: | | |
linux-x86-64-${{ runner.os }}-sdk | |
- name: Build SDK | |
shell: bash | |
run: | | |
mkdir -p $RUNNER_TEMP/lief-install | |
mkdir -p $HOME/.ccache | |
chmod -R 777 $HOME/.ccache | |
docker run --name lief-sdk -u 1001:1001 --rm \ | |
-e CCACHE_COMPRESS=1 \ | |
-e CCACHE_MAXSIZE=10.0G \ | |
-e CCACHE_DIR=/ccache \ | |
-v $GITHUB_WORKSPACE:/src \ | |
-v $RUNNER_TEMP/lief-install:/install \ | |
-v $HOME/.ccache:/ccache \ | |
liefproject/manylinux_2_28_x86_64 \ | |
bash /src/scripts/docker/linux-sdk-x64 | |
- name: 'Upload SDK Artifact' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-x86-64-sdk | |
path: build/*.tar.gz | |
retention-days: 3 | |
- name: 'Upload Install Artifact' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-x86-64-install | |
path: ${{ runner.temp }}/lief-install | |
retention-days: 1 | |
testing: | |
if: "!contains(github.event.commits[0].message, '[skip-test]')" | |
runs-on: ubuntu-latest | |
container: | |
image: liefproject/manylinux_2_28_x86_64 | |
env: | |
PYTHON_BINARY: "/opt/python/cp38-cp38/bin/python3.8" | |
LIEF_SAMPLES_DIR: "/tmp/samples" | |
LIEF_BUILD_DIR: "/tmp/lief-build" | |
LIEF_VENV: "/tmp/venv" | |
options: --user 1001:1001 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get Date | |
id: get-date | |
run: | | |
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: ccache cache files | |
uses: actions/cache@v3 | |
with: | |
path: ~/.ccache | |
key: linux-x86-64-${{ runner.os }}-test-${{ steps.get-date.outputs.date }} | |
restore-keys: | | |
linux-x86-64-${{ runner.os }}-test | |
- name: Prepare Python virtual env | |
shell: bash | |
run: | | |
$PYTHON_BINARY -m venv ${LIEF_VENV} | |
source ${LIEF_VENV}/bin/activate | |
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: Run tests | |
timeout-minutes: 5 | |
shell: bash | |
run: | | |
source ${LIEF_VENV}/bin/activate | |
python tests/run_pytest.py | |
python tests/run_tools_check.py ${LIEF_BUILD_DIR}/ | |
ctest --output-on-failure --test-dir ${LIEF_BUILD_DIR}/ | |
- name: Run fuzzing tests | |
shell: bash | |
timeout-minutes: 10 | |
run: | | |
source ${LIEF_VENV}/bin/activate | |
export PYTHONPATH="${GITHUB_WORKSPACE}/tests:$PYTHONPATH" | |
python tests/elf/fuzzing.py \ | |
${LIEF_BUILD_DIR}/tests/Melkor/src/MELKOR/melkor \ | |
--input-seed ${LIEF_SAMPLES_DIR}/ELF/ELF64_x86-64_binary_ls.bin -n 100 | |
python tests/elf/fuzzing.py \ | |
${LIEF_BUILD_DIR}/tests/Melkor/src/MELKOR/melkor \ | |
--input-seed ${LIEF_SAMPLES_DIR}/ELF/ELF64_x86-64_binary_openssl.bin -n 100 | |
python tests/elf/fuzzing.py \ | |
${LIEF_BUILD_DIR}/tests/Melkor/src/MELKOR/melkor \ | |
--input-seed ${LIEF_SAMPLES_DIR}/ELF/ELF64_x86-64_binary_nm.bin -n 100 | |
pywheels: | |
runs-on: ubuntu-latest | |
needs: linux-sdk | |
strategy: | |
matrix: | |
python-version: [3.8, 3.9, '3.10', '3.11', '3.12'] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Get Date | |
id: get-date | |
run: | | |
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: ccache cache files | |
uses: actions/cache@v3 | |
with: | |
path: ~/.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 | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
run: | | |
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 | |
- name: 'Artifact' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: linux-x86-64-python${{ matrix.python-version }}-wheel | |
path: dist/*.whl | |
retention-days: 3 | |
deploy: | |
runs-on: ubuntu-latest | |
if: ${{ always() }} | |
needs: [linux-sdk, pywheels] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: ${{ runner.temp }}/artifacts | |
- name: Display artifacts | |
run: ls -R | |
working-directory: ${{ runner.temp }}/artifacts | |
- name: Deploy | |
env: | |
LIEF_S3_KEY: ${{ secrets.LIEF_S3_KEY }} | |
LIEF_S3_SECRET: ${{ secrets.LIEF_S3_SECRET }} | |
shell: bash | |
run: | | |
docker run --rm \ | |
-v $GITHUB_WORKSPACE:/src \ | |
-v $RUNNER_TEMP:/runner_tmp \ | |
-e GITHUB_ACTIONS="true" \ | |
-e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \ | |
-e GITHUB_REF=$GITHUB_REF \ | |
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \ | |
-e LIEF_S3_KEY=$LIEF_S3_KEY \ | |
-e LIEF_S3_SECRET=$LIEF_S3_SECRET \ | |
liefproject/deploy \ | |
python3 /src/.github/deploy.py /runner_tmp/artifacts | |
documentation: | |
needs: [deploy] | |
runs-on: ubuntu-latest | |
container: | |
image: liefproject/manylinux_2_28_x86_64 | |
env: | |
CIRCLE_CI_URL: "https://circleci.com/api/v2/project/gh/lief-project/doc/pipeline" | |
CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }} | |
steps: | |
- name: Trigger documentation | |
if: github.ref == 'refs/heads/master' | |
run: | | |
curl --request POST --url ${CIRCLE_CI_URL} \ | |
--header "Circle-Token: ${CIRCLE_CI_TOKEN}" \ | |
--header 'content-type: application/json' \ | |
--data '{"parameters":{"lief-branch":"master"}}' |