-
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.
Github Actions other-project build test
- Loading branch information
1 parent
d53e3dc
commit deb9c49
Showing
4 changed files
with
162 additions
and
18 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,160 @@ | ||
name: Install to System | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- ".devcontainer/**" | ||
- ".vscode/**" | ||
- "doc/**" | ||
- "*.md" | ||
pull_request: | ||
paths-ignore: | ||
- ".devcontainer/**" | ||
- ".vscode/**" | ||
- "doc/**" | ||
- "*.md" | ||
|
||
jobs: | ||
library: | ||
name: Install Library | ||
strategy: | ||
matrix: | ||
os: ["linux", "macos"] | ||
architecture: ["x86_64", "arm64"] | ||
device: ["cpu", "cuda"] | ||
python-version: ["3.10"] | ||
exclude: | ||
- os: "macos" | ||
device: "cuda" | ||
# currently ARM runner is not supported | ||
- os: "linux" | ||
architecture: "arm64" | ||
include: | ||
- os: "linux" | ||
architecture: "x86_64" | ||
runs-on: "ubuntu-22.04" | ||
- os: "macos" | ||
architecture: "x86_64" | ||
runs-on: "macos-13" | ||
- os: "macos" | ||
architecture: "arm64" | ||
runs-on: "macos-14" | ||
runs-on: ${{ matrix.runs-on }} | ||
env: | ||
CMAKE_C_COMPILER: ${{ matrix.runs-on == 'macos-13' && '/usr/local/opt/ccache/libexec/gcc-14'|| matrix.runs-on == 'macos-14' && '/opt/homebrew/opt/ccache/libexec/gcc-14' || '/usr/lib/ccache/gcc' }} | ||
CMAKE_CXX_COMPILER: ${{ matrix.runs-on == 'macos-13' && '/usr/local/opt/ccache/libexec/g++-14'|| matrix.runs-on == 'macos-14' && '/opt/homebrew/opt/ccache/libexec/g++-14' || '/usr/lib/ccache/g++' }} | ||
SCALUQ_USE_CUDA: ${{ matrix.device == 'cuda' && 'ON' || 'OFF' }} | ||
SCALUQ_CUDA_ARCH: "PASCAL61" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Ninja | ||
if: ${{ matrix.os == 'linux' }} | ||
run: sudo apt update && sudo apt install ninja-build | ||
|
||
- name: Install Ninja | ||
if: ${{ matrix.os == 'macos' }} | ||
run: brew install ninja | ||
|
||
- name: Setup ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: "${{ github.job }}-${{ matrix.os }}-${{ matrix.architecture }}-${{ matrix.device }}" | ||
verbose: 2 | ||
|
||
- name: Install CUDA toolkit | ||
if: ${{ matrix.device == 'cuda' }} | ||
uses: Jimver/[email protected] | ||
with: | ||
cuda: "12.2.0" | ||
method: "network" | ||
|
||
- name: Show installed Compiler version | ||
run: | | ||
[ $SCALUQ_USE_CUDA = 'ON' ] && nvcc --version | ||
ccache --version | ||
$CMAKE_C_COMPILER --version | ||
$CMAKE_CXX_COMPILER --version | ||
cmake --version | ||
ninja --version | ||
- name: Configure | ||
run: ./script/configure | ||
|
||
- name: Install to system | ||
run: sudo ninja -C build install | ||
|
||
- name: Build and Run other project | ||
run: | | ||
cd example_project/ | ||
cmake -B build/ | ||
make -C build | ||
if [ "$SCALUQ_USE_CUDA" != 'ON']; then | ||
build/main | ||
fi | ||
python: | ||
name: Install Python package | ||
strategy: | ||
matrix: | ||
os: ["linux", "macos"] | ||
architecture: ["x86_64", "arm64"] | ||
device: ["cpu", "cuda"] | ||
python-version: ["3.10"] | ||
exclude: | ||
- os: "macos" | ||
device: "cuda" | ||
# currently ARM runner is not supported | ||
- os: "linux" | ||
architecture: "arm64" | ||
include: | ||
- os: "linux" | ||
architecture: "x86_64" | ||
runs-on: "ubuntu-22.04" | ||
- os: "macos" | ||
architecture: "x86_64" | ||
runs-on: "macos-13" | ||
- os: "macos" | ||
architecture: "arm64" | ||
runs-on: "macos-14" | ||
runs-on: ${{ matrix.runs-on }} | ||
env: | ||
CMAKE_C_COMPILER: ${{ matrix.runs-on == 'macos-13' && '/usr/local/opt/ccache/libexec/gcc-14'|| matrix.runs-on == 'macos-14' && '/opt/homebrew/opt/ccache/libexec/gcc-14' || '/usr/lib/ccache/gcc' }} | ||
CMAKE_CXX_COMPILER: ${{ matrix.runs-on == 'macos-13' && '/usr/local/opt/ccache/libexec/g++-14'|| matrix.runs-on == 'macos-14' && '/opt/homebrew/opt/ccache/libexec/g++-14' || '/usr/lib/ccache/g++' }} | ||
SCALUQ_USE_CUDA: ${{ matrix.device == 'cuda' && 'ON' || 'OFF' }} | ||
SCALUQ_CUDA_ARCH: "PASCAL61" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: "${{ github.job }}-${{ matrix.os }}-${{ matrix.architecture }}-${{ matrix.device }}" | ||
verbose: 2 | ||
|
||
- name: Install CUDA toolkit | ||
if: ${{ matrix.device == 'cuda' }} | ||
uses: Jimver/[email protected] | ||
with: | ||
cuda: "12.2.0" | ||
method: "network" | ||
|
||
- name: Show installed Compiler version | ||
run: | | ||
[ $SCALUQ_USE_CUDA = 'ON' ] && nvcc --version | ||
ccache --version | ||
$CMAKE_C_COMPILER --version | ||
$CMAKE_CXX_COMPILER --version | ||
- name: Install mypy | ||
run: pip install mypy | ||
|
||
- name: Install to system | ||
run: pip install . | ||
|
||
- name: Run / Test stub | ||
if: ${{ matrix.device == 'cpu' }} # currently GPU runner is not supported | ||
run: | | ||
echo -e "from scaluq import StateVector, gate\nstate = StateVector(2)\nx = gate.X(0)\nx.update_quantum_state(state)\nprint(state.get_amplitudes())" > /tmp/sample.py | ||
python3 /tmp/sample.py | ||
mypy /tmp/sample.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
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
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