Fix build failures and add reproducible development environment through devenv.nix #938
This file contains hidden or 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
| name: "macOS CI" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| release: | |
| types: | |
| - created | |
| jobs: | |
| build: | |
| runs-on: macos-12 | |
| name: "Mac CI" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| with: | |
| ref: ${{github.event.pull_request.head.ref}} | |
| repository: ${{github.event.pull_request.head.repo.full_name}} | |
| - uses: actions/setup-dotnet@v2 | |
| with: | |
| dotnet-version: "6.0.x" | |
| - name: "Installing dependencies" | |
| run: | | |
| rm '/usr/local/bin/2to3' | |
| brew install llvm@14 | |
| brew install cmake | |
| brew install python@3.9 | |
| brew unlink python@3.9 | |
| brew install node@16 | |
| brew link python@3.9 | |
| echo "/Users/runner/Library/Python/3.9/bin" >> $GITHUB_PATH | |
| echo "/usr/local/opt/llvm@14/bin" >> $GITHUB_PATH | |
| echo "/usr/local/opt/node@16/bin" >> $GITHUB_PATH | |
| echo "/Users/runner/Library/Python/3.9/lib/python/bin" >> $GITHUB_PATH | |
| echo "/usr/local/bin/$HOME/bin" >> $GITHUB_PATH | |
| git submodule update --init --recursive | |
| python3 -m pip install --upgrade pip | |
| pip3 install --user -r requirements.txt | |
| pip3 install virtualenv | |
| python3 -c "import autopep8;print(autopep8.__file__)" | |
| dotnet tool install --global Microsoft.Quantum.IQSharp --version 0.24.201332 | |
| npm install -g prettier@2.2.1 | |
| exec -l $SHELL | |
| - name: "Building" | |
| run: | | |
| mkdir Debug | |
| cd Debug | |
| cmake .. | |
| make | |
| env: | |
| LDFLAGS: "-L/usr/local/opt/llvm@14/lib -Wl,-rpath,/usr/local/opt/llvm@14/lib" | |
| CPPFLAGS: "-I/usr/local/opt/llvm@14/include" | |
| CC: clang | |
| CXX: clang++ | |
| - name: "Running Q# tests" | |
| run: | | |
| git clone https://github.com/microsoft/Quantum.git | |
| export QAT_BINARY=${PWD}/Debug/qir/qat/Apps/qat | |
| export QSHARP_SAMPLES=${PWD}/Quantum/samples | |
| pushd qir/qsharp-tests/ | |
| pip3 install --user pytest | |
| python3 -m pytest | |
| - name: "Running QIR tests" | |
| run: | | |
| mkdir -p Debug | |
| pushd Debug | |
| cmake .. | |
| make -j qat | |
| popd | |
| export QAT_BINARY=${PWD}/Debug/qir/qat/Apps/qat | |
| pip3 install pytest | |
| pip3 install -r requirements.txt | |
| cd qir/qir-tests/ | |
| python3 -m pytest | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| PYTHONUNBUFFERED: 1 | |
| PYTHON_BIN_PATH: /usr/bin/python3 | |
| CC: clang | |
| CXX: clang++ | |
| - name: "Running examples" | |
| run: | | |
| make test-examples | |
| env: | |
| LDFLAGS: "-L/usr/local/opt/llvm@14/lib -Wl,-rpath,/usr/local/opt/llvm@14/lib" | |
| CPPFLAGS: "-I/usr/local/opt/llvm@14/include" | |
| CC: clang | |
| CXX: clang++ | |
| - name: "Running Qiskit tests" | |
| run: | | |
| virtualenv develop_env | |
| source develop_env/bin/activate | |
| mkdir -p Debug | |
| pushd Debug | |
| cmake .. | |
| make -j qat | |
| popd | |
| git clone https://github.com/microsoft/qiskit-qir.git | |
| pushd qiskit-qir | |
| pip3 install -e . | |
| popd | |
| echo "Testing installation" | |
| python -c "from qiskit_qir import to_qir_module" | |
| echo "Done" | |
| export PYTHONPATH=$PWD/qiskit-qir/tests:$PYTHONPATH | |
| export QAT_BINARY=${PWD}/Debug/qir/qat/Apps/qat | |
| pushd qir/qiskit-tests/ | |
| pip3 install pytest | |
| python3 -m pytest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| CC: clang | |
| CXX: clang++ |