From 4fad184c57a99d4b17ec43ebf89fae4aa34e1a31 Mon Sep 17 00:00:00 2001 From: rturrado Date: Wed, 16 Oct 2024 15:29:41 +0200 Subject: [PATCH 1/6] Fix instruction set types. --- src/v3x/instruction_set.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/v3x/instruction_set.cpp b/src/v3x/instruction_set.cpp index 18322373..20d20df1 100644 --- a/src/v3x/instruction_set.cpp +++ b/src/v3x/instruction_set.cpp @@ -16,14 +16,14 @@ InstructionSet::InstructionSet() { "CR", { 'f', "QV" } }, { "CR", { 'f', "VQ" } }, { "CR", { 'f', "VV" } }, - { "CRk", { std::nullopt, "QQ" } }, - { "CRk", { std::nullopt, "QV" } }, - { "CRk", { std::nullopt, "VQ" } }, - { "CRk", { std::nullopt, "VV" } }, - { "CZ", { 'i', "QQ" } }, - { "CZ", { 'i', "QV" } }, - { "CZ", { 'i', "VQ" } }, - { "CZ", { 'i', "VV" } }, + { "CRk", { 'i', "QQ" } }, + { "CRk", { 'i', "QV" } }, + { "CRk", { 'i', "VQ" } }, + { "CRk", { 'i', "VV" } }, + { "CZ", { std::nullopt, "QQ" } }, + { "CZ", { std::nullopt, "QV" } }, + { "CZ", { std::nullopt, "VQ" } }, + { "CZ", { std::nullopt, "VV" } }, { "H", { std::nullopt, "Q" } }, { "H", { std::nullopt, "V" } }, { "I", { std::nullopt, "Q" } }, From 1a21433e19c7209148aa9c71d6c7d85466e13da5 Mon Sep 17 00:00:00 2001 From: rturrado Date: Wed, 16 Oct 2024 16:17:25 +0200 Subject: [PATCH 2/6] Run cpp-linux-arm64 job only on master. --- .github/workflows/test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c216b2f0..c8eec041 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -59,6 +59,8 @@ jobs: needs: cpp-linters runs-on: [self-hosted, ARM64, Linux] container: python:3.11 + # Run only on master (until we have a GitHub-hosted runner for Linux/ARM64) + if: github.ref == 'refs/heads/master' strategy: fail-fast: false matrix: From cb9acc1ff974517c9dce8fc07e7908bbe65563e2 Mon Sep 17 00:00:00 2001 From: rturrado Date: Wed, 16 Oct 2024 16:57:39 +0200 Subject: [PATCH 3/6] Testing 'Check all job status' for complete job. --- .github/workflows/test.yaml | 539 ++++++++++++++++++------------------ 1 file changed, 274 insertions(+), 265 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c8eec041..3939fad7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,51 +8,51 @@ on: pull_request: jobs: - cpp-linters: - name: "C++ linters" - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Run C++ linters - uses: cpp-linter/cpp-linter-action@v2 - id: linter - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - extensions: 'cpp,hpp' - files-changed-only: 'false' - format-review: 'true' - style: 'file' # use .clang-format config file - tidy-checks: '-*' # disable clang-tidy checks - version: 18 - - name: Fail fast - if: steps.linter.outputs.clang-format-checks-failed > 0 - run: | - echo "::notice::Try executing 'python3 ./scripts/run_cpp_linters.py .' to fix linter issues." - exit 1 - - cpp-linux-x64: - name: "C++ tests (gcc-clang/Linux/x64)" - needs: cpp-linters - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - build_type: - - Debug - - Release - compiler: - - clang - - gcc - steps: - - name: Checkout - uses: actions/checkout@v4 - - uses: ./.github/actions/cpp-tests - with: - build_type: ${{ matrix.build_type }} - conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-${{ matrix.compiler }}-linux-x64 - shell: bash +# cpp-linters: +# name: "C++ linters" +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Run C++ linters +# uses: cpp-linter/cpp-linter-action@v2 +# id: linter +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# extensions: 'cpp,hpp' +# files-changed-only: 'false' +# format-review: 'true' +# style: 'file' # use .clang-format config file +# tidy-checks: '-*' # disable clang-tidy checks +# version: 18 +# - name: Fail fast +# if: steps.linter.outputs.clang-format-checks-failed > 0 +# run: | +# echo "::notice::Try executing 'python3 ./scripts/run_cpp_linters.py .' to fix linter issues." +# exit 1 +# +# cpp-linux-x64: +# name: "C++ tests (gcc-clang/Linux/x64)" +# needs: cpp-linters +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# build_type: +# - Debug +# - Release +# compiler: +# - clang +# - gcc +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - uses: ./.github/actions/cpp-tests +# with: +# build_type: ${{ matrix.build_type }} +# conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-${{ matrix.compiler }}-linux-x64 +# shell: bash cpp-linux-arm64: name: "C++ tests (gcc/Linux/ARM64)" @@ -87,231 +87,231 @@ jobs: conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-gcc-linux-arm64 shell: bash - cpp-macos-x64: - name: "C++ tests (clang/MacOS/x64)" - needs: cpp-linters - runs-on: macos-13 # x64 - strategy: - fail-fast: false - matrix: - build_type: - - Debug - - Release - steps: - - name: Checkout - uses: actions/checkout@v4 - - uses: ./.github/actions/cpp-tests - with: - build_type: ${{ matrix.build_type }} - conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-apple_clang-macos-x64 - shell: bash - - cpp-macos-arm64: - name: "C++ tests (clang/macos/ARM64)" - needs: cpp-linters - runs-on: macos-14 # arm64 - strategy: - fail-fast: false - matrix: - build_type: - - Debug - - Release - steps: - - name: Checkout - uses: actions/checkout@v4 - - uses: ./.github/actions/cpp-tests - with: - build_type: ${{ matrix.build_type }} - conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-apple_clang-macos-arm64 - shell: bash - - cpp-windows-x64: - name: "C++ tests (msvc/Windows/x64)" - needs: cpp-linters - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - build_type: - - Debug - - Release - steps: - - name: Checkout - uses: actions/checkout@v4 - - uses: ./.github/actions/cpp-tests - with: - build_type: ${{ matrix.build_type }} - conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-msvc-windows-x64 - conan_profile_build: conan/profiles/tests-${{ matrix.build_type }}-msvc-windows-x64 - shell: bash - - cpp-shared: - name: "C++ tests (shared)" - needs: cpp-linters - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - build_type: - - Debug - - Release - steps: - - name: Checkout - uses: actions/checkout@v4 - - uses: ./.github/actions/cpp-tests - with: - build_type: ${{ matrix.build_type }} - conan_profile_host: conan/profiles/${{ matrix.build_type }}-gcc-linux-x64-shared - shell: bash - - ts-emscripten-wasm: - name: "TS tests (clang/emscripten/wasm)" - needs: cpp-linters - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - build_type: - - Release - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install node - uses: actions/setup-node@v4 - with: - node-version: 16.20.2 - - name: Install conan - run: | - pipx install conan - shell: bash - - name: Get latest CMake - uses: lukka/get-cmake@latest - # We clean the Conan cache as a preventive measure for our runs in self-hosted runners - # Self-hosted runners use containers that cache Conan packages from previous runs, - # and that can cause different type of problems - - name: Configure and build - run: | - conan profile detect --force - conan remove -c "*/*" - conan build . -pr=conan/profiles/release-clang-emscripten-wasm -pr:b=conan/profiles/release -b missing - shell: bash - - name: Rename cqasm_emscripten.js to cqasm_emscripten.mjs - working-directory: build/Release/emscripten - run: | - mv cqasm_emscripten.js cqasm_emscripten.mjs - shell: bash - - name: Install deno - uses: denoland/setup-deno@v1 - with: - deno-version: v1.x - - name: Test - working-directory: emscripten - run: | - deno run -A test_libqasm.ts - shell: bash - - python-linux-x64: - name: "Python tests (Linux/x64)" - needs: cpp-linters - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install SWIG - run: | - sudo apt-get install -y swig - shell: bash - - name: Export LIBQASM_BUILD_TYPE - run: | - echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV - shell: bash - - uses: ./.github/actions/python-tests - with: - shell: bash - - python-macos-x64: - name: "Python tests (macOS/x64)" - needs: cpp-linters - runs-on: macos-13 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install SWIG - run: | - brew install swig - shell: bash - - name: Export LIBQASM_BUILD_TYPE - run: | - echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV - shell: bash - - uses: ./.github/actions/python-tests - with: - shell: bash - - python-macos-arm64: - name: "Python tests (macOS/arm64)" - needs: cpp-linters - runs-on: macos-14 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install dependencies - run: | - brew install swig - shell: bash - - name: Export LIBQASM_BUILD_TYPE - run: | - echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV - shell: bash - - uses: ./.github/actions/python-tests - with: - shell: bash - - python-windows-x64: - name: "Python tests (Windows/x64)" - needs: cpp-linters - runs-on: windows-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Export LIBQASM_BUILD_TYPE - run: | - echo "LIBQASM_BUILD_TYPE=Release" >> $env:GITHUB_ENV - shell: powershell - - uses: ./.github/actions/python-tests - with: - shell: bash - - docker: - name: Docker - needs: cpp-linters - runs-on: ubuntu-latest - steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Build without pushing - uses: docker/build-push-action@v5 - with: - push: false - tags: libqasm:latest +# cpp-macos-x64: +# name: "C++ tests (clang/MacOS/x64)" +# needs: cpp-linters +# runs-on: macos-13 # x64 +# strategy: +# fail-fast: false +# matrix: +# build_type: +# - Debug +# - Release +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - uses: ./.github/actions/cpp-tests +# with: +# build_type: ${{ matrix.build_type }} +# conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-apple_clang-macos-x64 +# shell: bash +# +# cpp-macos-arm64: +# name: "C++ tests (clang/macos/ARM64)" +# needs: cpp-linters +# runs-on: macos-14 # arm64 +# strategy: +# fail-fast: false +# matrix: +# build_type: +# - Debug +# - Release +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - uses: ./.github/actions/cpp-tests +# with: +# build_type: ${{ matrix.build_type }} +# conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-apple_clang-macos-arm64 +# shell: bash +# +# cpp-windows-x64: +# name: "C++ tests (msvc/Windows/x64)" +# needs: cpp-linters +# runs-on: windows-latest +# strategy: +# fail-fast: false +# matrix: +# build_type: +# - Debug +# - Release +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - uses: ./.github/actions/cpp-tests +# with: +# build_type: ${{ matrix.build_type }} +# conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-msvc-windows-x64 +# conan_profile_build: conan/profiles/tests-${{ matrix.build_type }}-msvc-windows-x64 +# shell: bash +# +# cpp-shared: +# name: "C++ tests (shared)" +# needs: cpp-linters +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# build_type: +# - Debug +# - Release +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - uses: ./.github/actions/cpp-tests +# with: +# build_type: ${{ matrix.build_type }} +# conan_profile_host: conan/profiles/${{ matrix.build_type }}-gcc-linux-x64-shared +# shell: bash +# +# ts-emscripten-wasm: +# name: "TS tests (clang/emscripten/wasm)" +# needs: cpp-linters +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# build_type: +# - Release +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Install node +# uses: actions/setup-node@v4 +# with: +# node-version: 16.20.2 +# - name: Install conan +# run: | +# pipx install conan +# shell: bash +# - name: Get latest CMake +# uses: lukka/get-cmake@latest +# # We clean the Conan cache as a preventive measure for our runs in self-hosted runners +# # Self-hosted runners use containers that cache Conan packages from previous runs, +# # and that can cause different type of problems +# - name: Configure and build +# run: | +# conan profile detect --force +# conan remove -c "*/*" +# conan build . -pr=conan/profiles/release-clang-emscripten-wasm -pr:b=conan/profiles/release -b missing +# shell: bash +# - name: Rename cqasm_emscripten.js to cqasm_emscripten.mjs +# working-directory: build/Release/emscripten +# run: | +# mv cqasm_emscripten.js cqasm_emscripten.mjs +# shell: bash +# - name: Install deno +# uses: denoland/setup-deno@v1 +# with: +# deno-version: v1.x +# - name: Test +# working-directory: emscripten +# run: | +# deno run -A test_libqasm.ts +# shell: bash +# +# python-linux-x64: +# name: "Python tests (Linux/x64)" +# needs: cpp-linters +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Install SWIG +# run: | +# sudo apt-get install -y swig +# shell: bash +# - name: Export LIBQASM_BUILD_TYPE +# run: | +# echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV +# shell: bash +# - uses: ./.github/actions/python-tests +# with: +# shell: bash +# +# python-macos-x64: +# name: "Python tests (macOS/x64)" +# needs: cpp-linters +# runs-on: macos-13 +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Install SWIG +# run: | +# brew install swig +# shell: bash +# - name: Export LIBQASM_BUILD_TYPE +# run: | +# echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV +# shell: bash +# - uses: ./.github/actions/python-tests +# with: +# shell: bash +# +# python-macos-arm64: +# name: "Python tests (macOS/arm64)" +# needs: cpp-linters +# runs-on: macos-14 +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Install dependencies +# run: | +# brew install swig +# shell: bash +# - name: Export LIBQASM_BUILD_TYPE +# run: | +# echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV +# shell: bash +# - uses: ./.github/actions/python-tests +# with: +# shell: bash +# +# python-windows-x64: +# name: "Python tests (Windows/x64)" +# needs: cpp-linters +# runs-on: windows-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Export LIBQASM_BUILD_TYPE +# run: | +# echo "LIBQASM_BUILD_TYPE=Release" >> $env:GITHUB_ENV +# shell: powershell +# - uses: ./.github/actions/python-tests +# with: +# shell: bash +# +# docker: +# name: Docker +# needs: cpp-linters +# runs-on: ubuntu-latest +# steps: +# - name: Set up QEMU +# uses: docker/setup-qemu-action@v3 +# - name: Set up Docker Buildx +# uses: docker/setup-buildx-action@v3 +# - name: Build without pushing +# uses: docker/build-push-action@v5 +# with: +# push: false +# tags: libqasm:latest complete: # see https://github.community/t/status-check-for-a-matrix-jobs/127354/7 name: Report status needs: - - cpp-shared - - cpp-linux-x64 - - cpp-macos-x64 - - cpp-windows-x64 +# - cpp-shared +# - cpp-linux-x64 +# - cpp-macos-x64 +# - cpp-windows-x64 - cpp-linux-arm64 - - cpp-macos-arm64 - - ts-emscripten-wasm - - python-linux-x64 - - python-macos-x64 - - python-windows-x64 - - docker +# - cpp-macos-arm64 +# - ts-emscripten-wasm +# - python-linux-x64 +# - python-macos-x64 +# - python-windows-x64 +# - docker if: ${{ always() }} runs-on: ubuntu-latest steps: @@ -322,6 +322,15 @@ jobs: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') - || contains(needs.*.result, 'skipped') + || ( + github.ref != 'refs/heads/master' + && contains(needs.*.result, 'skipped') + && !contains(needs.cpp-linux-arm64.result, 'skipped') + ) + || + ( + github.ref == 'refs/heads/master' + && contains(needs.*.result, 'skipped') + ) }} run: exit 1 From 540db62ff78963db5fc7d3d041835f029739a06f Mon Sep 17 00:00:00 2001 From: rturrado Date: Wed, 16 Oct 2024 16:59:08 +0200 Subject: [PATCH 4/6] Testing 'Check all job status' for complete job. --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3939fad7..6f539061 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -56,7 +56,7 @@ jobs: cpp-linux-arm64: name: "C++ tests (gcc/Linux/ARM64)" - needs: cpp-linters +# needs: cpp-linters runs-on: [self-hosted, ARM64, Linux] container: python:3.11 # Run only on master (until we have a GitHub-hosted runner for Linux/ARM64) From b842c7c57cf82ad3bb3ee4358ca922f361965893 Mon Sep 17 00:00:00 2001 From: rturrado Date: Wed, 16 Oct 2024 17:02:04 +0200 Subject: [PATCH 5/6] Testing 'Check all job status' for complete job. --- .github/workflows/test.yaml | 530 ++++++++++++++++++------------------ 1 file changed, 265 insertions(+), 265 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6f539061..bc04e462 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -8,55 +8,55 @@ on: pull_request: jobs: -# cpp-linters: -# name: "C++ linters" -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - name: Run C++ linters -# uses: cpp-linter/cpp-linter-action@v2 -# id: linter -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# with: -# extensions: 'cpp,hpp' -# files-changed-only: 'false' -# format-review: 'true' -# style: 'file' # use .clang-format config file -# tidy-checks: '-*' # disable clang-tidy checks -# version: 18 -# - name: Fail fast -# if: steps.linter.outputs.clang-format-checks-failed > 0 -# run: | -# echo "::notice::Try executing 'python3 ./scripts/run_cpp_linters.py .' to fix linter issues." -# exit 1 -# -# cpp-linux-x64: -# name: "C++ tests (gcc-clang/Linux/x64)" -# needs: cpp-linters -# runs-on: ubuntu-latest -# strategy: -# fail-fast: false -# matrix: -# build_type: -# - Debug -# - Release -# compiler: -# - clang -# - gcc -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - uses: ./.github/actions/cpp-tests -# with: -# build_type: ${{ matrix.build_type }} -# conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-${{ matrix.compiler }}-linux-x64 -# shell: bash + cpp-linters: + name: "C++ linters" + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Run C++ linters + uses: cpp-linter/cpp-linter-action@v2 + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + extensions: 'cpp,hpp' + files-changed-only: 'false' + format-review: 'true' + style: 'file' # use .clang-format config file + tidy-checks: '-*' # disable clang-tidy checks + version: 18 + - name: Fail fast + if: steps.linter.outputs.clang-format-checks-failed > 0 + run: | + echo "::notice::Try executing 'python3 ./scripts/run_cpp_linters.py .' to fix linter issues." + exit 1 + + cpp-linux-x64: + name: "C++ tests (gcc-clang/Linux/x64)" + needs: cpp-linters + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + build_type: + - Debug + - Release + compiler: + - clang + - gcc + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: ./.github/actions/cpp-tests + with: + build_type: ${{ matrix.build_type }} + conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-${{ matrix.compiler }}-linux-x64 + shell: bash cpp-linux-arm64: name: "C++ tests (gcc/Linux/ARM64)" -# needs: cpp-linters + needs: cpp-linters runs-on: [self-hosted, ARM64, Linux] container: python:3.11 # Run only on master (until we have a GitHub-hosted runner for Linux/ARM64) @@ -87,231 +87,231 @@ jobs: conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-gcc-linux-arm64 shell: bash -# cpp-macos-x64: -# name: "C++ tests (clang/MacOS/x64)" -# needs: cpp-linters -# runs-on: macos-13 # x64 -# strategy: -# fail-fast: false -# matrix: -# build_type: -# - Debug -# - Release -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - uses: ./.github/actions/cpp-tests -# with: -# build_type: ${{ matrix.build_type }} -# conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-apple_clang-macos-x64 -# shell: bash -# -# cpp-macos-arm64: -# name: "C++ tests (clang/macos/ARM64)" -# needs: cpp-linters -# runs-on: macos-14 # arm64 -# strategy: -# fail-fast: false -# matrix: -# build_type: -# - Debug -# - Release -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - uses: ./.github/actions/cpp-tests -# with: -# build_type: ${{ matrix.build_type }} -# conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-apple_clang-macos-arm64 -# shell: bash -# -# cpp-windows-x64: -# name: "C++ tests (msvc/Windows/x64)" -# needs: cpp-linters -# runs-on: windows-latest -# strategy: -# fail-fast: false -# matrix: -# build_type: -# - Debug -# - Release -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - uses: ./.github/actions/cpp-tests -# with: -# build_type: ${{ matrix.build_type }} -# conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-msvc-windows-x64 -# conan_profile_build: conan/profiles/tests-${{ matrix.build_type }}-msvc-windows-x64 -# shell: bash -# -# cpp-shared: -# name: "C++ tests (shared)" -# needs: cpp-linters -# runs-on: ubuntu-latest -# strategy: -# fail-fast: false -# matrix: -# build_type: -# - Debug -# - Release -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - uses: ./.github/actions/cpp-tests -# with: -# build_type: ${{ matrix.build_type }} -# conan_profile_host: conan/profiles/${{ matrix.build_type }}-gcc-linux-x64-shared -# shell: bash -# -# ts-emscripten-wasm: -# name: "TS tests (clang/emscripten/wasm)" -# needs: cpp-linters -# runs-on: ubuntu-latest -# strategy: -# fail-fast: false -# matrix: -# build_type: -# - Release -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - name: Install node -# uses: actions/setup-node@v4 -# with: -# node-version: 16.20.2 -# - name: Install conan -# run: | -# pipx install conan -# shell: bash -# - name: Get latest CMake -# uses: lukka/get-cmake@latest -# # We clean the Conan cache as a preventive measure for our runs in self-hosted runners -# # Self-hosted runners use containers that cache Conan packages from previous runs, -# # and that can cause different type of problems -# - name: Configure and build -# run: | -# conan profile detect --force -# conan remove -c "*/*" -# conan build . -pr=conan/profiles/release-clang-emscripten-wasm -pr:b=conan/profiles/release -b missing -# shell: bash -# - name: Rename cqasm_emscripten.js to cqasm_emscripten.mjs -# working-directory: build/Release/emscripten -# run: | -# mv cqasm_emscripten.js cqasm_emscripten.mjs -# shell: bash -# - name: Install deno -# uses: denoland/setup-deno@v1 -# with: -# deno-version: v1.x -# - name: Test -# working-directory: emscripten -# run: | -# deno run -A test_libqasm.ts -# shell: bash -# -# python-linux-x64: -# name: "Python tests (Linux/x64)" -# needs: cpp-linters -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - name: Install SWIG -# run: | -# sudo apt-get install -y swig -# shell: bash -# - name: Export LIBQASM_BUILD_TYPE -# run: | -# echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV -# shell: bash -# - uses: ./.github/actions/python-tests -# with: -# shell: bash -# -# python-macos-x64: -# name: "Python tests (macOS/x64)" -# needs: cpp-linters -# runs-on: macos-13 -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - name: Install SWIG -# run: | -# brew install swig -# shell: bash -# - name: Export LIBQASM_BUILD_TYPE -# run: | -# echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV -# shell: bash -# - uses: ./.github/actions/python-tests -# with: -# shell: bash -# -# python-macos-arm64: -# name: "Python tests (macOS/arm64)" -# needs: cpp-linters -# runs-on: macos-14 -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - name: Install dependencies -# run: | -# brew install swig -# shell: bash -# - name: Export LIBQASM_BUILD_TYPE -# run: | -# echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV -# shell: bash -# - uses: ./.github/actions/python-tests -# with: -# shell: bash -# -# python-windows-x64: -# name: "Python tests (Windows/x64)" -# needs: cpp-linters -# runs-on: windows-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - name: Export LIBQASM_BUILD_TYPE -# run: | -# echo "LIBQASM_BUILD_TYPE=Release" >> $env:GITHUB_ENV -# shell: powershell -# - uses: ./.github/actions/python-tests -# with: -# shell: bash -# -# docker: -# name: Docker -# needs: cpp-linters -# runs-on: ubuntu-latest -# steps: -# - name: Set up QEMU -# uses: docker/setup-qemu-action@v3 -# - name: Set up Docker Buildx -# uses: docker/setup-buildx-action@v3 -# - name: Build without pushing -# uses: docker/build-push-action@v5 -# with: -# push: false -# tags: libqasm:latest + cpp-macos-x64: + name: "C++ tests (clang/MacOS/x64)" + needs: cpp-linters + runs-on: macos-13 # x64 + strategy: + fail-fast: false + matrix: + build_type: + - Debug + - Release + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: ./.github/actions/cpp-tests + with: + build_type: ${{ matrix.build_type }} + conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-apple_clang-macos-x64 + shell: bash + + cpp-macos-arm64: + name: "C++ tests (clang/macos/ARM64)" + needs: cpp-linters + runs-on: macos-14 # arm64 + strategy: + fail-fast: false + matrix: + build_type: + - Debug + - Release + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: ./.github/actions/cpp-tests + with: + build_type: ${{ matrix.build_type }} + conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-apple_clang-macos-arm64 + shell: bash + + cpp-windows-x64: + name: "C++ tests (msvc/Windows/x64)" + needs: cpp-linters + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + build_type: + - Debug + - Release + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: ./.github/actions/cpp-tests + with: + build_type: ${{ matrix.build_type }} + conan_profile_host: conan/profiles/tests-${{ matrix.build_type }}-msvc-windows-x64 + conan_profile_build: conan/profiles/tests-${{ matrix.build_type }}-msvc-windows-x64 + shell: bash + + cpp-shared: + name: "C++ tests (shared)" + needs: cpp-linters + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + build_type: + - Debug + - Release + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: ./.github/actions/cpp-tests + with: + build_type: ${{ matrix.build_type }} + conan_profile_host: conan/profiles/${{ matrix.build_type }}-gcc-linux-x64-shared + shell: bash + + ts-emscripten-wasm: + name: "TS tests (clang/emscripten/wasm)" + needs: cpp-linters + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + build_type: + - Release + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install node + uses: actions/setup-node@v4 + with: + node-version: 16.20.2 + - name: Install conan + run: | + pipx install conan + shell: bash + - name: Get latest CMake + uses: lukka/get-cmake@latest + # We clean the Conan cache as a preventive measure for our runs in self-hosted runners + # Self-hosted runners use containers that cache Conan packages from previous runs, + # and that can cause different type of problems + - name: Configure and build + run: | + conan profile detect --force + conan remove -c "*/*" + conan build . -pr=conan/profiles/release-clang-emscripten-wasm -pr:b=conan/profiles/release -b missing + shell: bash + - name: Rename cqasm_emscripten.js to cqasm_emscripten.mjs + working-directory: build/Release/emscripten + run: | + mv cqasm_emscripten.js cqasm_emscripten.mjs + shell: bash + - name: Install deno + uses: denoland/setup-deno@v1 + with: + deno-version: v1.x + - name: Test + working-directory: emscripten + run: | + deno run -A test_libqasm.ts + shell: bash + + python-linux-x64: + name: "Python tests (Linux/x64)" + needs: cpp-linters + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install SWIG + run: | + sudo apt-get install -y swig + shell: bash + - name: Export LIBQASM_BUILD_TYPE + run: | + echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV + shell: bash + - uses: ./.github/actions/python-tests + with: + shell: bash + + python-macos-x64: + name: "Python tests (macOS/x64)" + needs: cpp-linters + runs-on: macos-13 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install SWIG + run: | + brew install swig + shell: bash + - name: Export LIBQASM_BUILD_TYPE + run: | + echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV + shell: bash + - uses: ./.github/actions/python-tests + with: + shell: bash + + python-macos-arm64: + name: "Python tests (macOS/arm64)" + needs: cpp-linters + runs-on: macos-14 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install dependencies + run: | + brew install swig + shell: bash + - name: Export LIBQASM_BUILD_TYPE + run: | + echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV + shell: bash + - uses: ./.github/actions/python-tests + with: + shell: bash + + python-windows-x64: + name: "Python tests (Windows/x64)" + needs: cpp-linters + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Export LIBQASM_BUILD_TYPE + run: | + echo "LIBQASM_BUILD_TYPE=Release" >> $env:GITHUB_ENV + shell: powershell + - uses: ./.github/actions/python-tests + with: + shell: bash + + docker: + name: Docker + needs: cpp-linters + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build without pushing + uses: docker/build-push-action@v5 + with: + push: false + tags: libqasm:latest complete: # see https://github.community/t/status-check-for-a-matrix-jobs/127354/7 name: Report status needs: -# - cpp-shared -# - cpp-linux-x64 -# - cpp-macos-x64 -# - cpp-windows-x64 + - cpp-shared + - cpp-linux-x64 + - cpp-macos-x64 + - cpp-windows-x64 - cpp-linux-arm64 -# - cpp-macos-arm64 -# - ts-emscripten-wasm -# - python-linux-x64 -# - python-macos-x64 -# - python-windows-x64 -# - docker + - cpp-macos-arm64 + - ts-emscripten-wasm + - python-linux-x64 + - python-macos-x64 + - python-windows-x64 + - docker if: ${{ always() }} runs-on: ubuntu-latest steps: From 992691cb1dd41bf2a61708a88a830b49d4a585d2 Mon Sep 17 00:00:00 2001 From: rturrado Date: Wed, 16 Oct 2024 17:50:12 +0200 Subject: [PATCH 6/6] Change the cpp-linux-arm64 job to run only when merging to develop. --- .github/workflows/test.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index bc04e462..4acd1a2c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -59,8 +59,8 @@ jobs: needs: cpp-linters runs-on: [self-hosted, ARM64, Linux] container: python:3.11 - # Run only on master (until we have a GitHub-hosted runner for Linux/ARM64) - if: github.ref == 'refs/heads/master' + # Run only when merging to develop (until we have a GitHub-hosted runner for Linux/ARM64) + if: github.ref == 'refs/heads/develop' strategy: fail-fast: false matrix: @@ -323,13 +323,13 @@ jobs: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || ( - github.ref != 'refs/heads/master' + github.ref != 'refs/heads/develop' && contains(needs.*.result, 'skipped') && !contains(needs.cpp-linux-arm64.result, 'skipped') ) || ( - github.ref == 'refs/heads/master' + github.ref == 'refs/heads/develop' && contains(needs.*.result, 'skipped') ) }}