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 benchmark CI step #36

Open
wants to merge 2 commits into
base: main
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
40 changes: 20 additions & 20 deletions .github/workflows/dissect-ci-template-self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Dissect Self Hosted CI Template
on:
workflow_call:
inputs:
run_tests:
run-tests:
required: false
type: boolean
default: true
run_linting:
run-linting:
required: false
type: boolean
default: true
Expand Down Expand Up @@ -52,36 +52,36 @@ jobs:
needs: build
runs-on: ubuntu-latest-sh
steps:
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
uses: actions/checkout@v4
with:
fetch-depth: 0

# Caching LFS objects
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
name: Create LFS file list
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
name: Cache LFS
uses: actions/cache@v4
with:
path: .git/lfs
key: lfs-${{ hashFiles('.lfs-assets-id') }}-v1
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
name: Pull LFS
run: git lfs pull

- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "pyproject.toml"
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
run: pip install "tox==4.2.4"
- if: ${{ inputs.run_linting == true && github.ref_name == 'main' }}
- if: ${{ inputs.run-linting == true && github.ref_name == 'main' }}
run: sed -i 's/\[tool.setuptools_scm\]/\[tool.setuptools_scm\]\nlocal_scheme = "no-local-version"/' pyproject.toml
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
env:
C_INCLUDE_PATH: ${{ env.pythonLocation }}/include/python3.9
run: tox run -e lint
Expand Down Expand Up @@ -109,43 +109,43 @@ jobs:
- python-version: "3.13"
allow_failure: true
steps:
- if: ${{ inputs.run_tests == true && inputs.deb-packages != '' && ! startsWith(matrix.os, 'windows') }}
- if: ${{ inputs.run-tests == true && inputs.deb-packages != '' && ! startsWith(matrix.os, 'windows') }}
run: sudo apt-get install -qq ${{ inputs.deb-packages }}
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
uses: actions/checkout@v4
with:
fetch-depth: 0

# Caching LFS objects
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
name: Create LFS file list
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
name: Cache LFS
uses: actions/cache@v4
with:
path: .git/lfs
key: lfs-${{ hashFiles('.lfs-assets-id') }}-v1
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
name: Pull LFS
run: git lfs pull

- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "pyproject.toml"
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
run: pip install "tox==${{ matrix.tox-version }}"
- if: ${{ inputs.run_tests == true && github.ref_name == 'main' && ! startsWith(matrix.os, 'windows') }}
- if: ${{ inputs.run-tests == true && github.ref_name == 'main' && ! startsWith(matrix.os, 'windows') }}
run: sed -i 's/\[tool.setuptools_scm\]/\[tool.setuptools_scm\]\nlocal_scheme = "no-local-version"/' pyproject.toml
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
env:
PIP_INDEX_URL: ${{ secrets.DISSECT_PIP_INDEX_URL }}
C_INCLUDE_PATH: ${{ env.pythonLocation }}/include/${{ matrix.include-prefix }}${{ matrix.python-version }}
run: tox run -e ${{ matrix.python-version }}
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.DISSECT_CODECOV_TOKEN }}
Expand Down
84 changes: 64 additions & 20 deletions .github/workflows/dissect-ci-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ name: Dissect CI Template
on:
workflow_call:
inputs:
run_tests:
run-tests:
required: false
type: boolean
default: true
run_linting:
run-linting:
required: false
type: boolean
default: true
run-benchmarks:
required: false
type: boolean
default: false
deb-packages:
required: false
type: string
Expand Down Expand Up @@ -57,36 +61,36 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
uses: actions/checkout@v4
with:
fetch-depth: 0

# Caching LFS objects
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
name: Create LFS file list
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
name: Cache LFS
uses: actions/cache@v4
with:
path: .git/lfs
key: lfs-${{ hashFiles('.lfs-assets-id') }}-v1
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
name: Pull LFS
run: git lfs pull

- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
uses: actions/setup-python@v5
with:
python-version: "3.9"
cache: "pip"
cache-dependency-path: "pyproject.toml"
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
run: pip install "tox==4.4.3"
- if: ${{ inputs.run_linting == true && github.ref_name == 'main' }}
- if: ${{ inputs.run-linting == true && github.ref_name == 'main' }}
run: sed -i 's/\[tool.setuptools_scm\]/\[tool.setuptools_scm\]\nlocal_scheme = "no-local-version"/' pyproject.toml
- if: ${{ inputs.run_linting == true }}
- if: ${{ inputs.run-linting == true }}
env:
C_INCLUDE_PATH: ${{ env.pythonLocation }}/include/python3.9
run: tox run -e lint
Expand Down Expand Up @@ -118,46 +122,86 @@ jobs:
- python-version: "3.13"
allow_failure: true
steps:
- if: ${{ inputs.run_tests == true && inputs.deb-packages != '' && ! startsWith(matrix.os, 'windows') }}
- if: ${{ inputs.run-tests == true && inputs.deb-packages != '' && ! startsWith(matrix.os, 'windows') }}
run: sudo apt-get install -qq ${{ inputs.deb-packages }}
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
uses: actions/checkout@v4
with:
fetch-depth: 0

# Caching LFS objects
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
name: Create LFS file list
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
name: Cache LFS
uses: actions/cache@v4
with:
path: .git/lfs
key: lfs-${{ hashFiles('.lfs-assets-id') }}-v1
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
name: Pull LFS
run: git lfs pull

- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "pyproject.toml"
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
run: pip install "tox==${{ matrix.tox-version }}"
- if: ${{ inputs.run_tests == true && github.ref_name == 'main' && ! startsWith(matrix.os, 'windows') }}
- if: ${{ inputs.run-tests == true && github.ref_name == 'main' && ! startsWith(matrix.os, 'windows') }}
run: sed -i 's/\[tool.setuptools_scm\]/\[tool.setuptools_scm\]\nlocal_scheme = "no-local-version"/' pyproject.toml
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
env:
C_INCLUDE_PATH: ${{ env.pythonLocation }}/include/${{ matrix.include-prefix }}${{ matrix.python-version }}
run: tox run -e ${{ matrix.python-version }}
- if: ${{ inputs.run_tests == true }}
- if: ${{ inputs.run-tests == true }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.DISSECT_CODECOV_TOKEN }}
env_vars: PYTHON
files: coverage.xml
flags: unittests
verbose: true

benchmark:
needs: build
runs-on: ubuntu-latest
steps:
- if: ${{ inputs.run-benchmarks == true }}
uses: actions/checkout@v4
with:
fetch-depth: 0

# Caching LFS objects
- if: ${{ inputs.run-benchmarks == true }}
name: Create LFS file list
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id
- if: ${{ inputs.run-benchmarks == true }}
name: Cache LFS
uses: actions/cache@v4
with:
path: .git/lfs
key: lfs-${{ hashFiles('.lfs-assets-id') }}-v1
- if: ${{ inputs.run-benchmarks == true }}
name: Pull LFS
run: git lfs pull

- if: ${{ inputs.run-benchmarks == true }}
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: "pip"
cache-dependency-path: "pyproject.toml"
- if: ${{ inputs.run-benchmarks == true }}
run: pip install "tox==4.4.3"
- if: ${{ inputs.run-benchmarks == true && github.ref_name == 'main' }}
run: sed -i 's/\[tool.setuptools_scm\]/\[tool.setuptools_scm\]\nlocal_scheme = "no-local-version"/' pyproject.toml
- if: ${{ inputs.run-benchmarks == true }}
uses: CodSpeedHQ/action@v3
with:
run: tox run -e benchmark
env:
C_INCLUDE_PATH: ${{ env.pythonLocation }}/include/python3.13