Skip to content

Commit

Permalink
Merge branch 'benfred:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
manuels authored Dec 28, 2021
2 parents cc5d11a + 4417b18 commit aa9edf9
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 34 deletions.
49 changes: 48 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,61 @@ jobs:
name: wheels
path: dist

build-freebsd:
runs-on: macos-10.15
timeout-minutes: 30
strategy:
matrix:
box:
- fbsd_12_2
steps:
- uses: actions/checkout@v2
- name: Cache Vagrant box
uses: actions/cache@v2
with:
path: ~/.vagrant.d
key: ${{ matrix.box }}-vagrant-boxes-${{ hashFiles('ci/Vagrantfile') }}
restore-keys: |
${{ matrix.box }}-vagrant-
- name: Cache Cargo and build artifacts
uses: actions/[email protected]
with:
path: build-artifacts.tar
key: ${{ matrix.box }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.box }}-cargo-
- name: Set up VM
run: |
ln -sf ci/Vagrantfile Vagrantfile
if [ ! -d ~/.vagrant.d/boxes/rbspy-VAGRANTSLASH-FreeBSD-12.2-STABLE ]; then
vagrant box add rbspy/FreeBSD-12.2-STABLE https://github.com/rbspy/freebsd-vagrant-box/releases/download/20211124/fbsd_12_2.box
fi
vagrant up ${{ matrix.box }}
- name: Build and test
run: vagrant ssh ${{ matrix.box }} -- bash /vagrant/ci/test_freebsd.sh
- name: Retrieve build artifacts for caching purposes
run: |
vagrant ssh-config --host "default" > config.txt
scp -F config.txt default:/vagrant/build-artifacts.tar .
ls -ahl build-artifacts.tar
- name: Prepare binary for upload
run: |
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@v2
with:
name: py-spy-x86_64-unknown-freebsd
path: py-spy-x86_64-unknown-freebsd

test-wheels:
name: Test Wheels
needs: [build, build-linux-cross]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
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.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.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.10.0]
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.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.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.10.0, 3.10.1]
# TODO: also test windows
os: [ubuntu-latest, macos-latest]
steps:
Expand Down
39 changes: 8 additions & 31 deletions ci/Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,17 @@
# This code is taken from the Vagrantfile from libjail-rs
# https://github.com/fubarnetes/libjail-rs/blob/727353bd6565c5e7a9be2664258d0197a1c8bb35/Vagrantfile
# licensed under BSD-3 Clause License:
# BSD 3-Clause License

# Copyright (c) 2018, Fabian Freyer <[email protected]> All rights reserved.

# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

# * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

# * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

# * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Vagrant.configure("2") do |config|
config.vm.define "fbsd_13_0" do |fbsd_13_0|
fbsd_13_0.vm.box = "freebsd/FreeBSD-13.0-RELEASE"
end

config.vm.define "fbsd_12_2" do |fbsd_12_2|
fbsd_12_2.vm.box = "freebsd/FreeBSD-12.2-STABLE"
fbsd_12_2.vm.box = "rbspy/FreeBSD-12.2-STABLE"
end

config.vm.synced_folder ".", "/vagrant", type: "rsync",
rsync__exclude: ".git/",
rsync__auto: true
rsync__exclude: [".git", ".vagrant.d"]

config.vm.provision "shell", inline: <<~SHELL
pkg bootstrap
pkg install -y curl python llvm
su vagrant <<EOF
# we seem to be broken on rust 1.53 and 1.54 https://github.com/benfred/py-spy/pull/407
# so force using 1.52.1
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.52.1;
EOF
pkg install -y python
SHELL

config.vm.provider "virtualbox" do |v|
v.memory = 4096
v.cpus = 2
end
end
23 changes: 21 additions & 2 deletions ci/test_freebsd.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
source $HOME/.cargo/env
#!/usr/bin/env bash

source ~/.bash_profile

set -e

python -v
cargo --version

export CARGO_HOME="/vagrant/.cargo"
mkdir -p $CARGO_HOME

cd /vagrant
cargo build --release

if [ -f build-artifacts.tar ]; then
tar xf build-artifacts.tar
rm -f build-artifacts.tar
fi

cargo build --release --workspace --all-targets
cargo test --release

tar cf build-artifacts.tar target

0 comments on commit aa9edf9

Please sign in to comment.