windows openssl #132
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
# Runs on merge requests only | |
name: Test Python | |
on: | |
pull_request: | |
paths: | |
- 'pyultima/**' | |
- 'ultibi/**' | |
- 'frtb_engine/**' | |
- '.github/workflows/test-python.yaml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
working-directory: pyultima | |
jobs: | |
python_test_ubuntu: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.9', '3.11'] | |
services: | |
# mysql | |
mysql: | |
image: ghcr.io/wangxiaoying/mysql:latest | |
env: | |
MYSQL_DATABASE: ultima | |
MYSQL_ROOT_PASSWORD: mysql | |
LANG: C.UTF-8 | |
ports: | |
- 3306:3306 | |
options: >- | |
--health-cmd "mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 10s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: 'pyultima/requirements.txt' | |
- name: Create virtual environment | |
run: | | |
python -m venv venv | |
echo "$GITHUB_WORKSPACE/pyultima/venv/bin" >> $GITHUB_PATH | |
- name: Install tools | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y curl mysql-client mysql-server | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install mysqlclient | |
pip install -r requirements.txt | |
# Allow untyped calls for older Python versions | |
- name: Run mypy | |
run: mypy #${{ (matrix.python-version == '3.9') && '--allow-untyped-calls' || '' }} | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: pyultima | |
- name: Setup node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "16.x" | |
- name: Install Node | |
run: npm install | |
working-directory: frontend | |
- name: Build Node | |
run: npm run build | |
working-directory: frontend | |
- name: Install Ultima | |
env: | |
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down | |
run: | | |
source activate | |
maturin develop --all-features | |
- name: Run tests and report coverage | |
run: pytest --cov | |
- name: Run doctests | |
run: python tests/docs/run_doc_examples.py | |
python_test_windows: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.9', '3.11'] | |
env: | |
OPENSSL_NO_VENDOR: 1 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install OpenSSL (Windows) | |
if: runner.os == 'Windows' | |
shell: powershell | |
run: | | |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append | |
vcpkg install openssl:x64-windows-static-md | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
cache-dependency-path: 'pyultima/requirements.txt' | |
- name: Install Python dependencies | |
run: | | |
pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Cache Rust | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: pyultima | |
- name: Setup node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "16.x" | |
- name: Install Node | |
run: npm install | |
working-directory: frontend | |
- name: Build Node | |
run: npm run build | |
working-directory: frontend | |
- name: Install Ultima | |
shell: bash | |
env: | |
RUSTFLAGS: -C debuginfo=0 # Do not produce debug symbols to keep memory usage down | |
# we do build and install to better mimic real life | |
run: | | |
maturin build --all-features | |
pip install ../target/wheels/ultibi-*.whl | |
- name: Run tests | |
run: pytest | |