-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from qognitive/feature/release-workflow
refactor workflow to enable releases
- Loading branch information
Showing
3 changed files
with
87 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Build/Test | ||
runs: | ||
using: "composite" | ||
steps: | ||
- 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 |
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
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 |
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
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 |