From 8dda0b1d2a660e35566d8e786552d29af2d4e97a Mon Sep 17 00:00:00 2001 From: burgholzer Date: Mon, 26 Aug 2024 22:57:36 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20switch=20to=20reusable=20M?= =?UTF-8?q?QT=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- .github/workflows/cd.yml | 2 +- .github/workflows/ci.yml | 6 +- .github/workflows/reusable-cpp-ci.yml | 75 ------------- .github/workflows/reusable-python-ci.yml | 105 ------------------ .../workflows/reusable-python-packaging.yml | 82 -------------- 5 files changed, 5 insertions(+), 265 deletions(-) delete mode 100644 .github/workflows/reusable-cpp-ci.yml delete mode 100644 .github/workflows/reusable-python-ci.yml delete mode 100644 .github/workflows/reusable-python-packaging.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2db8b96b..a9b3d6d0 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -10,7 +10,7 @@ on: jobs: python-packaging: name: 🐍 Packaging - uses: ./.github/workflows/reusable-python-packaging.yml + uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.3 deploy: if: github.event_name == 'release' && github.event.action == 'published' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 348b1de6..6d119635 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: name: 🇨‌ Test needs: change-detection if: fromJSON(needs.change-detection.outputs.run-cpp-tests) - uses: ./.github/workflows/reusable-cpp-ci.yml + uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.3 cpp-linter: name: 🇨‌ Lint @@ -32,7 +32,9 @@ jobs: name: 🐍 Test needs: change-detection if: fromJSON(needs.change-detection.outputs.run-python-tests) - uses: ./.github/workflows/reusable-python-ci.yml + uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-ci.yml@v1.3 + with: + skip-testing-latest-python: true code-ql: name: 📝 CodeQL diff --git a/.github/workflows/reusable-cpp-ci.yml b/.github/workflows/reusable-cpp-ci.yml deleted file mode 100644 index 764bd9b8..00000000 --- a/.github/workflows/reusable-cpp-ci.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: 🇨‌ • CI -on: - workflow_call: - -env: - CMAKE_BUILD_PARALLEL_LEVEL: 4 - CTEST_PARALLEL_LEVEL: 4 - -defaults: - run: - shell: bash - -jobs: - cpp-tests: - name: ${{ matrix.runs-on }} - strategy: - fail-fast: false - matrix: - runs-on: [ubuntu-latest, macos-13, macos-14] - runs-on: ${{ matrix.runs-on }} - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Setup ccache - uses: Chocobo1/setup-ccache-action@v1 - with: - override_cache_key: c++-tests-${{ matrix.runs-on }} - - name: Set up mold as linker - uses: rui314/setup-mold@v1 - - name: Install Ninja - run: pipx install ninja - - name: Configure CMake - run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release - - name: Build - run: cmake --build build --config Release - - name: Test - run: ctest -C Release --output-on-failure --test-dir build --repeat until-pass:3 --timeout 600 - - name: Configure CMake (debug) - run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug - - name: Build - run: cmake --build build --config Debug - - name: Test - run: ctest -C Debug --output-on-failure --test-dir build --repeat until-pass:3 --timeout 600 - - coverage: - name: 📈 Coverage - runs-on: ubuntu-latest - permissions: - id-token: write - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - name: Setup ccache - uses: Chocobo1/setup-ccache-action@v1 - with: - prepend_symlinks_to_path: false - override_cache_key: c++-coverage - - name: Set up mold as linker - uses: rui314/setup-mold@v1 - - name: Install Ninja - run: pipx install ninja - - name: Configure CMake - run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DENABLE_COVERAGE=ON - - name: Build - run: cmake --build build --config Debug - - name: Test - run: ctest -C Debug --output-on-failure --test-dir build --repeat until-pass:3 --timeout 600 - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true - flags: cpp - use_oidc: true diff --git a/.github/workflows/reusable-python-ci.yml b/.github/workflows/reusable-python-ci.yml deleted file mode 100644 index ab2538b7..00000000 --- a/.github/workflows/reusable-python-ci.yml +++ /dev/null @@ -1,105 +0,0 @@ -name: 🐍 • CI - -on: - workflow_call: - -env: - FORCE_COLOR: 3 - -jobs: - lint: - runs-on: ubuntu-latest - name: 🚨 Lint - steps: - - uses: actions/checkout@v4 - # set up ccache for faster C++ builds - - name: Setup ccache - uses: Chocobo1/setup-ccache-action@v1 - with: - prepend_symlinks_to_path: false - override_cache_key: lint - # set up mold as linker for faster C++ builds - - name: Set up mold as linker - uses: rui314/setup-mold@v1 - # set up uv for faster Python package management - - uses: yezz123/setup-uv@v4 - # set up nox for convenient linting - - uses: wntrblm/nox@2024.04.15 - with: - python-versions: "3.12" - # run the nox lint session (assumes a nox session named "lint" exists, and `mypy` is configured in pre-commit) - - name: Run mypy - run: nox -s lint -- mypy - # run check-sdist to ensure the package sdist is correct - - name: Run check-sdist - run: pipx run check-sdist --inject-junk - - python-tests: - name: 🐍 ${{ matrix.python-version }} Tests on ${{ matrix.runs-on }} - runs-on: ${{ matrix.runs-on }} - strategy: - fail-fast: false - matrix: - runs-on: [ubuntu-latest] - python-version: ["3.9", "3.10", "3.11", "3.12"] - include: - - runs-on: macos-13 - python-version: "3.9" - - runs-on: macos-13 - python-version: "3.12" - - runs-on: macos-14 - python-version: "3.9" - - runs-on: macos-14 - python-version: "3.12" - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - - name: Setup ccache - uses: Chocobo1/setup-ccache-action@v1 - with: - override_cache_key: python-tests-${{ matrix.runs-on }}-${{ matrix.python-version }} - # set up mold as linker for faster C++ builds (Linux only) - - name: Set up mold as linker (Linux only) - uses: rui314/setup-mold@v1 - # set up uv for faster Python package management - - uses: yezz123/setup-uv@v4 - # set up nox for convenient testing - - uses: wntrblm/nox@2024.04.15 - with: - python-versions: ${{ matrix.python-version }} - # run the nox minimums session (assumes a nox session named "minimums" exists) with coverage - - name: Test on 🐍 ${{ matrix.python-version }} with minimal versions - run: nox -s minimums-${{ matrix.python-version }} --verbose -- --cov --cov-report=xml:coverage-${{ matrix.python-version }}-${{ matrix.runs-on }}.xml - # run the nox tests session (assumes a nox session named "tests" exists) with coverage - - name: Test on 🐍 ${{ matrix.python-version }} - run: nox -s tests-${{ matrix.python-version }} --verbose -- --cov --cov-report=xml:coverage-${{ matrix.python-version }}-${{ matrix.runs-on }}.xml --cov-append - # upload the report as an artifact to GitHub so that it can later be uploaded to Codecov - - name: Upload coverage report for 🐍 ${{ matrix.python-version }} on ${{ matrix.runs-on }} - uses: actions/upload-artifact@v4 - with: - name: coverage-${{ matrix.python-version }}-${{ matrix.runs-on }} - path: coverage-* - - python-coverage-upload: - name: 📈 - needs: [python-tests] - runs-on: ubuntu-latest - permissions: - id-token: write - steps: - # check out the repository (mostly for the codecov config) - - uses: actions/checkout@v4 - # download coverage reports from all jobs - - uses: actions/download-artifact@v4 - with: - pattern: coverage-* - path: coverage-reports - merge-multiple: true - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: true - flags: python - use_oidc: true diff --git a/.github/workflows/reusable-python-packaging.yml b/.github/workflows/reusable-python-packaging.yml deleted file mode 100644 index b2985efa..00000000 --- a/.github/workflows/reusable-python-packaging.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: 🐍 • Packaging - -on: - workflow_call: - -jobs: - build_wheels: - name: ${{ matrix.runs-on }} wheels - runs-on: ${{ matrix.runs-on }} - strategy: - fail-fast: false - matrix: - runs-on: [ubuntu-latest, macos-13, macos-14] - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - if: matrix.runs-on != 'ubuntu-latest' - name: Setup ccache - uses: Chocobo1/setup-ccache-action@v1 - with: - prepend_symlinks_to_path: false - override_cache_key: wheels-${{ matrix.runs-on }} - - if: runner.os == 'macOS' - name: Install gmp from source - run: | - curl -L https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz | tar xJ - cd gmp-6.3.0 - export CC="ccache clang" - export CXX="ccache clang++" - export MACOSX_DEPLOYMENT_TARGET=11.0 - ./configure --enable-cxx --prefix=/usr/local - make -j 4 && sudo make install - echo GMP_ROOT="/usr/local" >> $GITHUB_ENV - - if: runner.os == 'macOS' - name: Install mpfr from source - run: | - curl -L https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.xz | tar xJ - cd mpfr-4.2.1 - export CC="ccache clang" - export CXX="ccache clang++" - export MACOSX_DEPLOYMENT_TARGET=11.0 - # use the GMP install from above - ./configure --prefix=/usr/local --with-gmp=/usr/local - make -j 4 && sudo make install - echo MPFR_ROOT="/usr/local" >> $GITHUB_ENV - # set up uv for faster Python package management - - if: runner.os == 'macOS' - uses: yezz123/setup-uv@v4 - - name: Build wheels - uses: pypa/cibuildwheel@v2.20 - - name: Verify clean directory - run: git diff --exit-code - shell: bash - - uses: actions/upload-artifact@v4 - with: - name: cibw-wheels-${{ matrix.runs-on }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl - - build_sdist: - name: 📦 SDist - runs-on: ubuntu-latest - steps: - # check out the repository (including submodules and all history) - - uses: actions/checkout@v4 - with: - submodules: recursive - fetch-depth: 0 - # set up uv for faster Python package management - - uses: yezz123/setup-uv@v4 - # build the source distribution - - name: Build SDist - run: pipx run build --sdist --installer uv - # check the metadata of the source distribution - - name: Check metadata - run: pipx run twine check dist/* - # upload the source distribution as an artifact - - uses: actions/upload-artifact@v4 - with: - name: cibw-sdist - path: dist/*.tar.gz