Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'whitelist' argument to limit the subprocesses being monitored #597

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 38 additions & 69 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,27 @@ env:
CARGO_TERM_COLOR: always

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]

build-linux-armv7:
runs-on: [self-hosted, linux, arm]
needs: [lint]
steps:
- name: Setup python
run: |
pyenv global system
python --version
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test

build:
runs-on: ${{ matrix.os }}
needs: [lint]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Install Dependencies
run: sudo apt install libunwind-dev
if: runner.os == 'Linux'
Expand All @@ -60,14 +51,13 @@ jobs:
- name: Test (retry#2)
run: cargo test --release
if: steps.test1.outcome=='failure'
- uses: actions/setup-python@v4
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Build Wheel
run: |
pip install --upgrade maturin
maturin build --release -o dist
if: runner.os != 'Linux'
- name: Build Wheel - universal2
env:
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
Expand All @@ -76,22 +66,20 @@ jobs:
run: |
rustup target add aarch64-apple-darwin
pip install --upgrade maturin
maturin build --release -o dist --target universal2-apple-darwin
maturin build --release -o dist --universal2
if: matrix.os == 'macos-latest'
- name: Rename Wheels
run: |
python3 -c "import shutil; import glob; wheels = glob.glob('dist/*.whl'); [shutil.move(wheel, wheel.replace('py3', 'py2.py3')) for wheel in wheels if 'py2' not in wheel]"
if: runner.os != 'Linux'
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist
if: runner.os != 'Linux'

build-linux-cross:
runs-on: ubuntu-latest
needs: [lint]
strategy:
fail-fast: false
matrix:
Expand All @@ -102,64 +90,60 @@ jobs:
RUSTUP_HOME: /root/.rustup
CARGO_HOME: /root/.cargo
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Build
run: |
python3 -m pip install --upgrade maturin
maturin build --release -o dist --target $RUST_MUSL_CROSS_TARGET
maturin sdist -o dist
- name: Rename Wheels
run: |
python3 -c "import shutil; import glob; wheels = glob.glob('dist/*.whl'); [shutil.move(wheel, wheel.replace('py3', 'py2.py3')) for wheel in wheels if 'py2' not in wheel]"
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

build-freebsd:
runs-on: ubuntu-22.04
needs: [lint]
runs-on: macos-10.15
timeout-minutes: 30
strategy:
matrix:
box:
- freebsd-14
include:
- box: fbsd_13_1
release: FreeBSD-13.1-STABLE
url: https://github.com/rbspy/freebsd-vagrant-box/releases/download/20220703/fbsd_13_1.box
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Cache Vagrant box
uses: actions/cache@v3.0.4
uses: actions/cache@v2
with:
path: .vagrant.d
key: ${{ matrix.box }}-vagrant-boxes-20231115-${{ hashFiles('ci/Vagrantfile') }}
path: ~/.vagrant.d
key: ${{ matrix.box }}-vagrant-boxes-${{ hashFiles('ci/Vagrantfile') }}
restore-keys: |
${{ matrix.box }}-vagrant-boxes-20231115-
${{ matrix.box }}-vagrant-
- name: Cache Cargo and build artifacts
uses: actions/cache@v3.0.4
uses: actions/cache@v2.1.4
with:
path: build-artifacts.tar
key: ${{ matrix.box }}-cargo-20231115-${{ hashFiles('**/Cargo.lock') }}
key: ${{ matrix.box }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.box }}-cargo-20231115-
- name: Display CPU info
run: lscpu
- name: Install VM tools
run: |
sudo apt-get install -qq -o=Dpkg::Use-Pty=0 moreutils
sudo chronic apt-get install -qq -o=Dpkg::Use-Pty=0 vagrant virtualbox qemu libvirt-daemon-system
${{ matrix.box }}-cargo-
- name: Set up VM
shell: sudo bash {0}
run: |
vagrant plugin install vagrant-libvirt
brew install vagrant
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-scp

ln -sf ci/Vagrantfile Vagrantfile
vagrant status
vagrant up --no-tty --provider libvirt ${{ matrix.box }}

if [ ! -d ~/.vagrant.d/boxes/rbspy-VAGRANTSLASH-${{ matrix.release }} ]; then
vagrant box add --no-tty rbspy/${{ matrix.release }} ${{ matrix.url }}
fi
vagrant up ${{ matrix.box }}
- name: Build and test
shell: sudo bash {0}
run: vagrant ssh ${{ matrix.box }} -- bash /vagrant/ci/test_freebsd.sh
- name: Retrieve build artifacts for caching purposes
shell: sudo bash {0}
run: |
vagrant scp ${{ matrix.box }}:/vagrant/build-artifacts.tar build-artifacts.tar
ls -ahl build-artifacts.tar
Expand All @@ -168,7 +152,7 @@ jobs:
tar xf build-artifacts.tar target/release/py-spy
mv target/release/py-spy py-spy-x86_64-unknown-freebsd
- name: Upload Binaries
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: py-spy-x86_64-unknown-freebsd
path: py-spy-x86_64-unknown-freebsd
Expand All @@ -180,30 +164,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.5.4, 3.5.9, 3.5.10, 3.6.7, 3.6.8, 3.6.9, 3.6.10, 3.6.11, 3.6.12, 3.6.13, 3.6.14, 3.6.15, 3.7.1, 3.7.2, 3.7.3, 3.7.4, 3.7.5, 3.7.6, 3.7.7, 3.7.8, 3.7.9, 3.7.10, 3.7.11, 3.7.12, 3.7.13, 3.7.14, 3.7.15, 3.7.16, 3.7.17, 3.8.0, 3.8.1, 3.8.2, 3.8.3, 3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.8.10, 3.8.11, 3.8.12, 3.8.13, 3.8.14, 3.8.15, 3.8.16, 3.8.17, 3.8.18, 3.9.0, 3.9.1, 3.9.2, 3.9.3, 3.9.4, 3.9.5, 3.9.6, 3.9.7, 3.9.8, 3.9.9, 3.9.10, 3.9.11, 3.9.12, 3.9.13, 3.9.14, 3.9.15, 3.9.16, 3.9.17, 3.9.18, 3.10.0, 3.10.1, 3.10.2, 3.10.3, 3.10.4, 3.10.5, 3.10.6, 3.10.7, 3.10.8, 3.10.9, 3.10.10, 3.10.11, 3.10.12, 3.10.13, 3.11.0, 3.11.1, 3.11.2, 3.11.3, 3.11.4, 3.11.5]
python-version: [2.7.17, 2.7.18, 3.5.4, 3.5.9, 3.5.10, 3.6.7, 3.6.8, 3.6.9, 3.6.10, 3.6.11, 3.6.12, 3.6.13, 3.6.14, 3.6.15, 3.7.1, 3.7.5, 3.7.6, 3.7.7, 3.7.8, 3.7.9, 3.7.10, 3.7.11, 3.7.12, 3.7.13, 3.8.0, 3.8.1, 3.8.2, 3.8.3, 3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.8.10, 3.8.11, 3.8.12, 3.8.13, 3.9.0, 3.9.1, 3.9.2, 3.9.3, 3.9.4, 3.9.5, 3.9.6, 3.9.7, 3.9.8, 3.9.9, 3.9.10, 3.9.11, 3.9.12, 3.9.13, 3.10.0, 3.10.1, 3.10.2, 3.10.3, 3.10.4, 3.10.5, 3.10.6, 3.10.7, 3.11.0-beta.5]
# TODO: also test windows
os: [ubuntu-20.04, macos-latest]
# some versions of python can't be tested on GHA with osx because of SIP:
exclude:
- os: macos-latest
python-version: 3.11.0
- os: macos-latest
python-version: 3.11.1
- os: macos-latest
python-version: 3.11.2
- os: macos-latest
python-version: 3.11.3
- os: macos-latest
python-version: 3.11.4
- os: macos-latest
python-version: 3.11.5

os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v2
with:
name: wheels
- uses: actions/setup-python@v4
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install wheel
Expand Down Expand Up @@ -248,8 +217,8 @@ jobs:
# only test out relatively recent versions of python
pyenv-python-version: [3.7.10, 3.8.9, 3.9.4]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: wheels
- name: Setup pyenv
Expand All @@ -271,7 +240,7 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
needs: [test-wheels, test-wheel-linux-armv7]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v2
with:
name: wheels
- name: Create GitHub Release
Expand All @@ -282,7 +251,7 @@ jobs:
- name: Install Dependencies
run: sudo apt install libunwind-dev
if: runner.os == 'Linux'
- uses: actions/setup-python@v4
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Push to PyPi
Expand All @@ -293,7 +262,7 @@ jobs:
pip install --upgrade wheel pip setuptools twine
twine upload *
rm *
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Push to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/update_python_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ jobs:
update-dep:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/setup-python@v4
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install
run: pip install --upgrade requests
- name: Scan for new python versions
run: python ci/update_python_test_versions.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v3
with:
commit-message: Update tested python versions
title: Update tested python versions
branch: update-python-versions
branch: update-python-versons
labels: |
skip-changelog
dependencies
21 changes: 0 additions & 21 deletions .pre-commit-config.yaml

This file was deleted.

Loading