Skip to content

Resolve #884

Resolve #884 #269

Workflow file for this run

name: LIEF Windows x86
on:
push:
branches:
- 'master'
- 'release-**'
- 'devel'
tags:
- '**'
jobs:
build:
runs-on: windows-2019
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', '3.11.0']
fail-fast: false
env:
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: "C:\\Users\\runner\\AppData\\Local\\Mozilla\\sccache"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: x86
- name: Install system dependencies
run: |
choco install ninja
choco install sccache
python -m pip install --upgrade pip setuptools
python -m pip install wheel mako
- uses: ilammy/msvc-dev-cmd@v1
with:
toolset: "14.16"
- name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")"
shell: bash
- name: Save sccache
uses: actions/cache@v3
continue-on-error: false
with:
path: "C:\\Users\\runner\\AppData\\Local\\Mozilla\\sccache"
key: ${{ runner.os }}-x86-sccache-${{ steps.get-date.outputs.date }}
restore-keys: |
${{ runner.os }}-x86-sccache-
- name: Start sccache server
run: sccache --start-server
- name: Set env variables
run: |
chcp 65001 #set code page to utf-8
echo ("LIEF_SAMPLES_DIR=" + $env:RUNNER_TEMP + "/samples") >> $env:GITHUB_ENV
- name: Set env variables
run: |
chcp 65001 #set code page to utf-8
echo ("PYLIEF_CONF=" + $env:GITHUB_WORKSPACE + "/scripts/windows/config-win32.toml") >> $env:GITHUB_ENV
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
shell: cmd
- name: ⛓ Build Python ${{ matrix.python-version }} & Test
if: matrix.python-version == 3.8
run: |
python -m pip install pytest requests
python tests/dl_samples.py %LIEF_SAMPLES_DIR%
python -m pip -vv wheel --wheel-dir=dist/ api/python
python -m pip -vv install api/python
python ./tests/run_pytest.py
shell: cmd
- name: ❱ Build Python ${{ matrix.python-version }}
if: matrix.python-version != 3.8
run: |
python -m pip -vv wheel --wheel-dir=dist/ api/python
shell: cmd
- name: ❱ Build SDK
if: matrix.python-version == 3.9
run: |
python ./scripts/windows/package_sdk.py
- name: 'Upload SDK Artifact'
if: matrix.python-version == 3.9
uses: actions/upload-artifact@v3
with:
name: windows-x86-sdk
path: build/*.zip
retention-days: 3
- name: 'Upload Python Wheel Artifact - ${{ matrix.python-version }}'
uses: actions/upload-artifact@v3
with:
name: windows-x86-wheel-${{ matrix.python-version }}
path: dist/*.whl
retention-days: 3
- name: 📊 Print sccache stats
run: sccache --show-stats
- name: 🛑 Stop sccache server
run: sccache --stop-server || true
- name: Setup WSL
uses: Vampire/setup-wsl@v1
with:
distribution: Debian
use-cache: 'true'
wsl-shell-user: root
set-as-default: 'true'
wsl-conf: |
[automount]
options = "metadata"
additional-packages:
ca-certificates
curl
locales
python3 python3-pip
git
openssl
ssh
- shell: wsl-bash {0}
name: Deploy
env:
LIEF_S3_KEY: ${{ secrets.LIEF_S3_KEY }}
LIEF_S3_SECRET: ${{ secrets.LIEF_S3_SECRET }}
GITHUB_ACTIONS: "true"
GITHUB_WORKSPACE: ${{ env.GITHUB_WORKSPACE }}
GITHUB_REF: ${{ env.GITHUB_REF }}
GITHUB_REPOSITORY: ${{ env.GITHUB_REPOSITORY }}
WSLENV: LIEF_S3_KEY:LIEF_S3_SECRET:GITHUB_ACTIONS:GITHUB_WORKSPACE:GITHUB_REF:GITHUB_REPOSITORY
run: |
python3 -m pip install --no-cache-dir --upgrade pip setuptools requests mako wheel boto3
python3 .github/deploy.py