From 4a73a2386d7440c783e1d97240e022fcecf55bd9 Mon Sep 17 00:00:00 2001 From: "Troels F. Roennow" Date: Mon, 22 Nov 2021 13:56:20 +0100 Subject: [PATCH 1/4] New build matrix --- .github/workflows/cd-docs.yml | 2 +- .github/workflows/cd-ubuntu-executable.yml | 63 ++++++++++++++++++---- 2 files changed, 55 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cd-docs.yml b/.github/workflows/cd-docs.yml index 23cc79dda..7198ef774 100644 --- a/.github/workflows/cd-docs.yml +++ b/.github/workflows/cd-docs.yml @@ -4,7 +4,7 @@ on: push: branches: - main - + jobs: build-and-deploy-docs: runs-on: ubuntu-latest diff --git a/.github/workflows/cd-ubuntu-executable.yml b/.github/workflows/cd-ubuntu-executable.yml index 8399571f0..c556274f4 100644 --- a/.github/workflows/cd-ubuntu-executable.yml +++ b/.github/workflows/cd-ubuntu-executable.yml @@ -1,22 +1,41 @@ -#on: -# push: -# tags: -# - 'v*' on: release: types: - created - - + pull_request: + branches: + - main + jobs: build: + runs-on: ${{ matrix.config.os }} + env: ${{ matrix.config.env }} + strategy: + fail-fast: false + matrix: + config: + - { + os: "ubuntu-20.04", + arch: "amd64", + env: {}, + } +# - { +# os: "windows-2019", +# arch: "amd64", +# env: {}, +# } + - { + os: "macOS-10.15", + arch: "amd64", + env: {}, + } name: Upload Release Asset - runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - - name: "Installing dependencies" + - name: "Installing Linux dependencies" + if: ${{ matrix.config.os == 'ubuntu-20.04' }} run: | sudo apt-get update -y sudo apt-get install -y @@ -37,6 +56,32 @@ jobs: CC: clang-11 CXX: clang++-11 + - name: "Installing Mac dependencies" + if: ${{ matrix.config.os == 'macOS-10.15' }} + run: | + rm '/usr/local/bin/2to3' + brew install llvm@11 + brew install cmake + brew install python@3.9 + brew unlink python@3.9 + brew link python@3.9 + echo "/usr/local/opt/llvm@11/bin" >> $GITHUB_PATH + git submodule update --init --recursive + pip3 install --user -r requirements.txt + dotnet tool install --global Microsoft.Quantum.IQSharp --version 0.20.2110171573 + chmod +x manage + + exec -l $SHELL + + - name: "Checking format" + run: | + ./manage stylecheck + env: + LDFLAGS: "-L/usr/local/opt/llvm@11/lib -Wl,-rpath,/usr/local/opt/llvm@11/lib" + CPPFLAGS: "-I/usr/local/opt/llvm@11/include" + CC: clang + CXX: clang++ + - name: "Running unit tests" run: | ./manage test @@ -51,7 +96,7 @@ jobs: run: | mkdir -p Release cd Release - cmake .. + cmake .. -DMICROSOFT_ENABLE_DYNAMIC_LOADING=0 make qat cd .. mv Release/qir/qat/Apps/qat ./ From ad7167d36f64ff205fb25ec963f65e01a0cff0f2 Mon Sep 17 00:00:00 2001 From: "Troels F. Roennow" Date: Mon, 22 Nov 2021 14:32:22 +0100 Subject: [PATCH 2/4] Updating release script --- ...tu-executable.yml => cd-linux-release.yml} | 61 ++-------------- .github/workflows/cd-mac-release.yml | 69 +++++++++++++++++++ 2 files changed, 76 insertions(+), 54 deletions(-) rename .github/workflows/{cd-ubuntu-executable.yml => cd-linux-release.yml} (56%) create mode 100644 .github/workflows/cd-mac-release.yml diff --git a/.github/workflows/cd-ubuntu-executable.yml b/.github/workflows/cd-linux-release.yml similarity index 56% rename from .github/workflows/cd-ubuntu-executable.yml rename to .github/workflows/cd-linux-release.yml index c556274f4..23cfeaa17 100644 --- a/.github/workflows/cd-ubuntu-executable.yml +++ b/.github/workflows/cd-linux-release.yml @@ -1,41 +1,20 @@ +name: Linux Release + on: release: types: - created - pull_request: - branches: - - main - + + jobs: build: - runs-on: ${{ matrix.config.os }} - env: ${{ matrix.config.env }} - strategy: - fail-fast: false - matrix: - config: - - { - os: "ubuntu-20.04", - arch: "amd64", - env: {}, - } -# - { -# os: "windows-2019", -# arch: "amd64", -# env: {}, -# } - - { - os: "macOS-10.15", - arch: "amd64", - env: {}, - } name: Upload Release Asset + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - - name: "Installing Linux dependencies" - if: ${{ matrix.config.os == 'ubuntu-20.04' }} + - name: "Installing dependencies" run: | sudo apt-get update -y sudo apt-get install -y @@ -56,32 +35,6 @@ jobs: CC: clang-11 CXX: clang++-11 - - name: "Installing Mac dependencies" - if: ${{ matrix.config.os == 'macOS-10.15' }} - run: | - rm '/usr/local/bin/2to3' - brew install llvm@11 - brew install cmake - brew install python@3.9 - brew unlink python@3.9 - brew link python@3.9 - echo "/usr/local/opt/llvm@11/bin" >> $GITHUB_PATH - git submodule update --init --recursive - pip3 install --user -r requirements.txt - dotnet tool install --global Microsoft.Quantum.IQSharp --version 0.20.2110171573 - chmod +x manage - - exec -l $SHELL - - - name: "Checking format" - run: | - ./manage stylecheck - env: - LDFLAGS: "-L/usr/local/opt/llvm@11/lib -Wl,-rpath,/usr/local/opt/llvm@11/lib" - CPPFLAGS: "-I/usr/local/opt/llvm@11/include" - CC: clang - CXX: clang++ - - name: "Running unit tests" run: | ./manage test @@ -96,7 +49,7 @@ jobs: run: | mkdir -p Release cd Release - cmake .. -DMICROSOFT_ENABLE_DYNAMIC_LOADING=0 + cmake .. make qat cd .. mv Release/qir/qat/Apps/qat ./ diff --git a/.github/workflows/cd-mac-release.yml b/.github/workflows/cd-mac-release.yml new file mode 100644 index 000000000..c6a26b53c --- /dev/null +++ b/.github/workflows/cd-mac-release.yml @@ -0,0 +1,69 @@ +name: Mac Release + +on: + release: + types: + - created + pull_request: + branches: + - main + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: "Installing dependencies" + run: | + rm '/usr/local/bin/2to3' + brew install llvm@11 + brew install cmake + brew install python@3.9 + brew unlink python@3.9 + brew link python@3.9 + echo "/usr/local/opt/llvm@11/bin" >> $GITHUB_PATH + git submodule update --init --recursive + pip3 install --user -r requirements.txt + dotnet tool install --global Microsoft.Quantum.IQSharp --version 0.20.2110171573 + chmod +x manage + + exec -l $SHELL + + - name: "Running unit tests" + run: | + ./manage test + env: + LDFLAGS: "-L/usr/local/opt/llvm@11/lib -Wl,-rpath,/usr/local/opt/llvm@11/lib" + CPPFLAGS: "-I/usr/local/opt/llvm@11/include" + CC: clang + CXX: clang++ + + - name: "Build project" + run: | + mkdir -p Release + cd Release + cmake .. -DMICROSOFT_ENABLE_DYNAMIC_LOADING=0 + make qat + cd .. + mv Release/qir/qat/Apps/qat ./ + chmod +x qat + tar cf qat-mac.zip qat + env: + LDFLAGS: "-L/usr/local/opt/llvm@11/lib -Wl,-rpath,/usr/local/opt/llvm@11/lib" + CPPFLAGS: "-I/usr/local/opt/llvm@11/include" + CC: clang + CXX: clang++ + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./qat-mac.zip + asset_name: qat-mac.zip + asset_content_type: application/zip \ No newline at end of file From 83e51d8c07279c3214071087e916bd663f76b66b Mon Sep 17 00:00:00 2001 From: "Troels F. Roennow" Date: Mon, 22 Nov 2021 14:34:00 +0100 Subject: [PATCH 3/4] Updating release script --- .github/workflows/cd-mac-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd-mac-release.yml b/.github/workflows/cd-mac-release.yml index c6a26b53c..9ff116c82 100644 --- a/.github/workflows/cd-mac-release.yml +++ b/.github/workflows/cd-mac-release.yml @@ -11,7 +11,7 @@ on: jobs: build: name: Upload Release Asset - runs-on: ubuntu-latest + runs-on: macos-11 steps: - name: Checkout code uses: actions/checkout@v2 From 74ddb9dc7a05b72c69ad5a9d19e2929a15265b0b Mon Sep 17 00:00:00 2001 From: "Troels F. Roennow" Date: Mon, 22 Nov 2021 15:02:18 +0100 Subject: [PATCH 4/4] Making Mac release script --- .github/workflows/cd-mac-release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/cd-mac-release.yml b/.github/workflows/cd-mac-release.yml index 9ff116c82..55c29b76d 100644 --- a/.github/workflows/cd-mac-release.yml +++ b/.github/workflows/cd-mac-release.yml @@ -4,9 +4,6 @@ on: release: types: - created - pull_request: - branches: - - main jobs: build: