diff --git a/.github/actions/build-composite/action.yaml b/.github/actions/build-composite/action.yaml new file mode 100644 index 0000000..3bbb805 --- /dev/null +++ b/.github/actions/build-composite/action.yaml @@ -0,0 +1,31 @@ +runs: + using: "composite" + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.12 + uses: actions/setup-python@v3 + with: + python-version: "3.12" + + - 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 + + - name: Lint + run: | + pdm run black $PROJECT_SRC_REL $PROJECT_SETUP --check + pdm run flake8 $PROJECT_SRC_REL $PROJECT_SETUP + + - name: PDM install + run: pdm install + + - name: conan install + run: | + source .venv/bin/activate + conan --version + conan profile detect + conan install --build=missing . + diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml deleted file mode 100644 index 9df8642..0000000 --- a/.github/workflows/python-app.yml +++ /dev/null @@ -1,50 +0,0 @@ -# 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: Python application - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -env: - PROJECT_SRC_REL: "src/algobench" - PROJECT_SETUP: "setup.py" - -permissions: - contents: read - -jobs: - build: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Set up Python 3.12 - uses: actions/setup-python@v3 - with: - python-version: "3.12" - - - 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 - - - name: Lint - run: | - pdm run black $PROJECT_SRC_REL $PROJECT_SETUP --check - pdm run flake8 $PROJECT_SRC_REL $PROJECT_SETUP - - - name: PDM install - run: pdm install - - - name: conan install - run: | - source .venv/bin/activate - conan --version - conan profile detect - conan install --build=missing . - diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml new file mode 100644 index 0000000..707cbe4 --- /dev/null +++ b/.github/workflows/workflow.yaml @@ -0,0 +1,24 @@ +# 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_act: + runs-on: ubuntu-24.04 + steps: + - name: composite + uses: ./.github/actions/build-composite