ci: Automatically publish docs for new releases #1575
Workflow file for this run
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
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@v3 | |
- 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@v3 | |
- 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@v3 | |
- 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: | |
name: "Lint" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install linting dependencies | |
run: | | |
python3 -m pip install -r requirements-extra.txt | |
- name: Lint sources | |
run: | | |
make lint MYPYPATH=src | |
valgrind: | |
name: "Valgrind & Helgrind" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 |