Skip to content

Add a "memory overview" section to the docs #1740

Add a "memory overview" section to the docs

Add a "memory overview" section to the docs #1740

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check_generated_files:
name: "Check if generated files are up to date"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -qy npm git
- name: Check if files are up to date
run: make build-js
- name: Check for changes
run: |
git add -u
changes=$(git status --porcelain)
# Check for changes in regenerated files
if test -n "$changes"; then
echo "Generated files not up to date."
echo "$changes"
echo ""
git diff --staged || true
exit 1
fi
test_with_coverage:
name: "Test with coverage"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -qy libunwind-dev liblz4-dev pkg-config npm gdb lldb lcov
- name: Create virtual environment
run: |
python3 -m venv venv
- name: Install Python dependencies
run: |
./venv/bin/python -m pip install --upgrade pip
- name: Disable ptrace security restrictions
run: |
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
- name: Run coverage
env:
CYTHON_TEST_MACROS: 1
PYTHON: ./venv/bin/python
run: |
make dev-install pycoverage
test_in_alpine:
name: "Test in Alpine Linux"
runs-on: ubuntu-latest
container:
image: alpine
options: --cap-add=SYS_PTRACE
steps:
- uses: actions/checkout@v4
- name: Set up dependencies
run: |
apk add --update build-base libunwind-dev lz4-dev musl-dev python3-dev python3-dbg gdb lldb git bash perl perl-datetime build-base perl-app-cpanminus
cpanm Date::Parse
cpanm Capture::Tiny
- name: Clone lcov repository
run: |
git clone https://github.com/linux-test-project/lcov.git
ls -al
- name: Build and install lcov
run: |
cd lcov
make install
- name: Create virtual environment
run: |
python3 -m venv /venv
- name: Install Python dependencies
run: |
/venv/bin/python -m pip install --upgrade pip
- name: Run coverage
env:
CYTHON_TEST_MACROS: 1
PYTHON: /venv/bin/python
GENHTMLOPTS: "--ignore-errors category"
run: |
make dev-install pycoverage
lint_and_docs:
name: "Lint and Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 16
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -qy clang-format npm libunwind-dev liblz4-dev pkg-config
- name: Install Python dependencies
run: |
python3 -m pip install -r requirements-extra.txt
- name: Install Package
run: |
python3 -m pip install -e .
- name: Lint sources
run: |
make lint
- name: Build docs
run: |
towncrier build --version 99.99 --name memray --keep
make docs
valgrind:
name: "Valgrind & Helgrind"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Set up dependencies
run: |
sudo apt-get update
sudo apt-get install -qy libunwind-dev liblz4-dev pkg-config npm valgrind
- name: Install Python dependencies and package
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements-test.txt
python3 -m pip install -e .
env:
MEMRAY_MINIMIZE_INLINING: 1
- name: Run Valgrind
run: make valgrind
- name: Run Helgrind
run: make helgrind