Skip to content

Commit

Permalink
Merge pull request #1 from bpuchala/2.X_cmake
Browse files Browse the repository at this point in the history
2.X CMake
  • Loading branch information
bpuchala authored Aug 17, 2023
2 parents 679e742 + 1716317 commit 5d571d5
Show file tree
Hide file tree
Showing 71 changed files with 5,674 additions and 3,136 deletions.
34 changes: 34 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
build_and_store_wheels: &BUILD_AND_STORE_WHEELS
install_cibuildwheel_script:
- python -m pip install cibuildwheel==2.14.1
run_cibuildwheel_script:
- cibuildwheel
wheels_artifacts:
path: "wheelhouse/*"

linux_aarch64_task:
name: Build Linux aarch64 wheels.
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder-arm64
architecture: arm64
platform: linux
cpu: 4
memory: 4G
env:
CIBW_ARCHS_LINUX: aarch64
install_pre_requirements_script:
- apt install -y python3-venv python-is-python3
<<: *BUILD_AND_STORE_WHEELS

macos_arm64_task:
name: Build macOS arm64 wheels.
macos_instance:
image: ghcr.io/cirruslabs/macos-monterey-xcode:latest
env:
PATH: /opt/homebrew/opt/[email protected]/bin:$PATH
CIBW_ARCHS_MACOS: arm64
install_pre_requirements_script:
- brew install [email protected]
- ln -s python3 /opt/homebrew/opt/[email protected]/bin/python
<<: *BUILD_AND_STORE_WHEELS
66 changes: 66 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build wheels

on: [push, pull_request]

jobs:
build_wheels_linux_x86_64:
name: Build x86_64 wheels on ubuntu-22.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: x86_64

- uses: actions/upload-artifact@v3
with:
name: dist
path: ./wheelhouse/*.whl

build_wheels_macos_x86_64:
name: Build x86_64 wheels on macos-12
runs-on: macos-12

steps:
- uses: actions/checkout@v3

- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: x86_64

- uses: actions/upload-artifact@v3
with:
name: dist
path: ./wheelhouse/*.whl

build_sdist:
name: Build sdist
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Set up requirements and configuration variables
run: |
sudo apt-get update
sudo apt-get install build-essential cmake
pip install --upgrade pip wheel build
- name: make
shell: bash
run: |
python -m build
- name: upload sdist
if: always()
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/*.tar.gz
56 changes: 56 additions & 0 deletions .github/workflows/test-linux-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Testing build on ubuntu-latest

on: [push, pull_request]

env:
SKBUILD_BUILD_OPTIONS: --verbose

jobs:
build-depends:
uses: ./.github/workflows/test-linux-dependencies.yml

build:
needs: build-depends
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Set up requirements & configuration variables
run: |
sudo apt-get update
sudo apt-get install build-essential cmake
pip install --upgrade pip wheel build
echo "SKBUILD_BUILD_OPTIONS=${{ env.SKBUILD_BUILD_OPTIONS }}" >> "$GITHUB_ENV"
### libcasm-global ###
- name: restore libcasm-global cache
id: cache-libcasm-global-restore
uses: actions/cache/restore@v3
with:
path: CASMcode_global/dist
key: ${{ runner.os }}-libcasm-global-v2-0-3

- name: Install CASM dependencies
run: |
pip install CASMcode_global/dist/*.whl
pip install -r build_requirements.txt
pip install -r test_requirements.txt
- name: make
shell: bash
run: |
python -m build
- name: make install
shell: bash
run: |
pip install dist/*.whl
- name: make test
shell: bash
run: |
python -m pytest -rsap python/tests
84 changes: 84 additions & 0 deletions .github/workflows/test-linux-cxx-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Testing c++ only on ubuntu-latest

on: [push, pull_request]

env:
SKBUILD_BUILD_OPTIONS: --verbose

jobs:
build-depends:
uses: ./.github/workflows/test-linux-dependencies.yml

build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Set up requirements & configuration variables
run: |
sudo apt-get update
sudo apt-get install build-essential cmake
pip install --upgrade pip wheel build
echo "SKBUILD_BUILD_OPTIONS=${{ env.SKBUILD_BUILD_OPTIONS }}" >> "$GITHUB_ENV"
### libcasm-global ###
- name: restore libcasm-global cache
id: cache-libcasm-global-restore
uses: actions/cache/restore@v3
with:
path: CASMcode_global/dist
key: ${{ runner.os }}-libcasm-global-v2-0-3

- name: Install CASM dependencies
run: |
pip install CASMcode_global/dist/*.whl
pip install -r build_requirements.txt
- name: configure
shell: bash
run: |
mkdir build_cxx_only
cd build_cxx_only
cmake -DCMAKE_BUILD_TYPE=Release ..
- name: make
shell: bash
run: |
cd build_cxx_only
make -j4 VERBOSE=1
- name: install
shell: bash
run: |
cd build_cxx_only
make install
- name: configure tests
shell: bash
run: |
mkdir build_cxx_test
cd build_cxx_test
cmake -DCMAKE_BUILD_TYPE=Release ../tests
- name: make tests
shell: bash
run: |
cd build_cxx_test
make -j4 VERBOSE=1
- name: run tests
shell: bash
run: |
cd build_cxx_test
make test
- name: upload test log
if: always()
uses: actions/upload-artifact@v3
with:
name: libcasm-composition-cxx-test-log
path: build_cxx_test/Testing/Temporary/LastTest.log
53 changes: 53 additions & 0 deletions .github/workflows/test-linux-dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build CASM dependencies on Ubuntu

on:
workflow_call:

jobs:
build-depends:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Set up requirements & configuration variables
run: |
sudo apt-get update
sudo apt-get install build-essential cmake
pip install --upgrade pip wheel build
### libcasm-global ###
- name: restore libcasm-global cache
id: cache-libcasm-global-restore
uses: actions/cache/restore@v3
with:
path: CASMcode_global/dist
key: ${{ runner.os }}-libcasm-global-v2-0-3

- name: checkout libcasm-global
if: steps.cache-libcasm-global-restore.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: prisms-center/CASMcode_global
path: CASMcode_global
ref: v2.0.3

- name: make global
if: steps.cache-libcasm-global-restore.outputs.cache-hit != 'true'
shell: bash
run: |
cd CASMcode_global
git submodule update --init --recursive
python -m build
pip install dist/*.whl
pip install -r test_requirements.txt
python -m pytest -rsap python/tests
- name: save libcasm-global cache
id: cache-libcasm-global-save
uses: actions/cache/save@v3
with:
path: CASMcode_global/dist
key: ${{ steps.cache-libcasm-global-restore.outputs.cache-primary-key }}
68 changes: 68 additions & 0 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Testing on ubuntu-latest

on: [push, pull_request]

env:
SKBUILD_BUILD_OPTIONS: --verbose

jobs:
build-depends:
uses: ./.github/workflows/test-linux-dependencies.yml

build:
needs: build-depends
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Set up requirements & configuration variables
run: |
sudo apt-get update
sudo apt-get install build-essential cmake
pip install --upgrade pip wheel
echo "SKBUILD_BUILD_OPTIONS=${{ env.SKBUILD_BUILD_OPTIONS }}" >> "$GITHUB_ENV"
### libcasm-global ###
- name: restore libcasm-global cache
id: cache-libcasm-global-restore
uses: actions/cache/restore@v3
with:
path: CASMcode_global/dist
key: ${{ runner.os }}-libcasm-global-v2-0-3

- name: Install CASM dependencies
run: |
pip install CASMcode_global/dist/*.whl
pip install -r build_requirements.txt
- name: make
shell: bash
run: |
pip install -v .
- name: make test
shell: bash
run: |
pip install -r test_requirements.txt
python -m pytest -rsap python/tests
- name: Set up doc requirements
run: |
pip install -r doc_requirements.txt
- name: build docs
shell: bash
run: |
cd python/doc
sphinx-build -b html . _build/html
- name: upload docs
if: always()
uses: actions/upload-artifact@v3
with:
name: libcasm-composition-docs
path: python/doc/_build/html
Loading

0 comments on commit 5d571d5

Please sign in to comment.