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

refactor workflow to enable releases #52

Merged
merged 16 commits into from
Oct 3, 2024
Merged
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
31 changes: 31 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build/Test
runs:
using: "composite"
steps:
jamesETsmith marked this conversation as resolved.
Show resolved Hide resolved
- name: Setup compiler
shell: bash
run: python3 ./.github/compiler_setup.py ${CXX} ${BUILD_OS}
- name: Install Python dependencies
shell: bash
run: python -m pip install cmake scikit-build-core
- name: Configure CMake
shell: bash
run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=${CXX}
- name: Build
shell: bash
run: |
cmake --build ${{github.workspace}}/build --verbose --parallel
- name: Install
shell: bash
run: |
cmake --install ${{github.workspace}}/build
python -m pip install ".[dev]" --no-build-isolation
- name: Test C++
shell: bash
env:
OMP_NUM_THREADS: 2
CPP_TEST_DIR: build/fast_pauli/cpp/tests
run: make test-cpp
- name: Test Python
shell: bash
run: make test-py
45 changes: 12 additions & 33 deletions .github/workflows/all_push.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,27 @@
name: Build/Test
on: [push]
name: "Push Build/Test"
on:
push:
branches-ignore:
- main
jobs:
build:
push-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
compiler: [g++-12, clang++-17]
python-version: ["3.10", "3.11", "3.12"]
include:
- os: macos-13
compiler: g++-12
python-version: 3.12
- os: macos-14
compiler: g++-12
python-version: 3.12
compiler: [clang++-17]
python-version: ["3.12"]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup compiler
run: python3 ./.github/compiler_setup.py ${{ matrix.compiler }} ${{ matrix.os }}
- name: Setup Python
- name: Push Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: python -m pip install cmake scikit-build-core
- name: Configure CMake
- name: Push Build
uses: ./.github/actions/build
env:
BUILD_OS: ${{ matrix.os }}
CXX: ${{ matrix.compiler }}
run: cmake -B ${{github.workspace}}/build -DCMAKE_CXX_COMPILER=${CXX}
- name: Build
run: |
cmake --build ${{github.workspace}}/build --verbose --parallel
- name: Install
run: |
cmake --install ${{github.workspace}}/build
python -m pip install ".[dev]" --no-build-isolation
- name: Test C++
env:
OMP_NUM_THREADS: 2
CPP_TEST_DIR: build/fast_pauli/cpp/tests
run: make test-cpp
- name: Test Python
run: make test-py
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# the name of this file must match the one in pypi.org config
name: Build/Test/Release
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
jobs:
main-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
compiler: [g++-12, clang++-17]
python-version: ["3.10", "3.11", "3.12"]
include:
- os: macos-13
compiler: g++-12
python-version: 3.12
- os: macos-14
compiler: g++-12
python-version: 3.12
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Main Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Main Build
uses: ./.github/actions/build
env:
BUILD_OS: ${{ matrix.os }}
CXX: ${{ matrix.compiler }}
- name: Publish release distributions to PyPI
if: github.event.release
uses: pypa/gh-action-pypi-publish@release/v1
Loading