Skip to content

Commit

Permalink
Basic conan setup (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
sin-diesel authored Nov 23, 2024
1 parent dfcf061 commit 7d86368
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 45 deletions.
29 changes: 29 additions & 0 deletions .github/actions/build-composite/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
runs:
using: "composite"
steps:
- name: Install dependencies
run: |
curl -sSLO https://pdm-project.org/install-pdm.py
curl -sSL https://pdm-project.org/install-pdm.py.sha256 | shasum -a 256 -c -
python3 install-pdm.py
pdm install
shell: bash

- name: Lint
run: |
pdm run black $PROJECT_SRC_REL $PROJECT_SETUP --check
pdm run flake8 $PROJECT_SRC_REL $PROJECT_SETUP
shell: bash

- name: PDM install
run: pdm install
shell: bash

- name: conan install
run: |
source .venv/bin/activate
conan --version
conan profile detect
conan install --build=missing .
shell: bash

41 changes: 0 additions & 41 deletions .github/workflows/python-app.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Algobench

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
PROJECT_SRC_REL: "src/algobench"
PROJECT_SETUP: "setup.py"

permissions:
contents: read

jobs:
build:
if: ${{ !github.event.act }}
runs-on: ubuntu-24.04
container:
image: docker.io/sindiesel/cpp_ubuntu:22.0.20
volumes:
- ${{ github.workspace }}:${{ github.workspace }}
steps:
- uses: actions/checkout@v4
- name: composite
uses: ./.github/actions/build-composite
build_act:
if: ${{ github.event.act }}
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: composite
uses: ./.github/actions/build-composite
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
# algobench
Python library designed for benchmarking standard C++ parallel algorithms, algotirhm policies on different standard libraries implementations, compilers and architectures.
Python library designed for benchmarking standard C++ parallel algorithms, algorithm policies on different standard libraries implementations, compilers and architectures.

## Testing in containerized environment
### Pull container image

podman pull docker.io/sindiesel/cpp_ubuntu:22.0.20

```bash
podman run --interactive --tty --detach \
--env "TERM=xterm-256color" \
--mount type=bind,source="$(pwd)",target="$(pwd)" \
--name cpp \
--userns keep-id \
--workdir "$HOME" \
cpp_ubuntu:22.0.20

# Allow non-root user
podman exec --user root cpp bash -c "chown $(id --user):$(id --group) $HOME"

# Run your command
podman exec --workdir "$(pwd)" cpp bash -c "ls -l"

# Attach to container
podman exec --workdir "$(pwd)" --interactive --tty cpp bash
```
15 changes: 15 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

from conan import ConanFile
from conan.tools.cmake import cmake_layout


class Algobench(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeDeps", "CMakeToolchain"

def requirements(self):
self.requires("gcc/12.2.0")

def layout(self):
cmake_layout(self)

3 changes: 3 additions & 0 deletions event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"act": true
}
6 changes: 3 additions & 3 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7d86368

Please sign in to comment.