From 4757349e03a207fdae327bf465d97c1beb120bbf Mon Sep 17 00:00:00 2001 From: Pieter Pas Date: Thu, 28 Mar 2024 15:37:15 +0100 Subject: [PATCH] [CI] upgrade GitHub actions --- .github/workflows/documentation.yml | 6 +- .github/workflows/linux.yml | 11 ++- .github/workflows/macos.yml | 10 +-- .github/workflows/matlab.yml | 13 ++- .github/workflows/toolchain/action.yml | 2 +- .github/workflows/wheel-short-test.yml | 10 +-- .github/workflows/wheel-upload.yml | 107 +++++++++++++------------ .github/workflows/windows.yml | 10 +-- 8 files changed, 87 insertions(+), 82 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index fd6f4c69..42376427 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # Cache the doxygen executable, lcov - - uses: actions/cache@v3 + - uses: actions/cache@v4 id: cache-tools with: path: | @@ -47,7 +47,7 @@ jobs: VIRTUAL_ENV: /tmp/gtest # Install Python - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.9' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b4dc3dc5..c78a3581 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -18,7 +18,7 @@ jobs: TOOLS_VERSION: '0.1.0-beta3' TOOLS_URL: 'https://github.com/tttapa/cross-python/releases/download' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install Ninja @@ -28,7 +28,6 @@ jobs: sudo mv ninja /usr/bin working-directory: /tmp - name: Download toolchain - if: steps.cache-tools.outputs.cache-hit != 'true' run: wget "${{ env.TOOLS_URL }}/${{ env.TOOLS_VERSION }}/full-${{ env.HOST }}.tar.xz" -O- | sudo tar xJ -C /opt - name: Configure run: | @@ -60,7 +59,7 @@ jobs: -D CPACK_INSTALL_CMAKE_PROJECTS=".;QPALM;ALL;/;LADEL;LADEL;ALL;/" working-directory: package - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: qpalm-linux path: package/QPALM-*-Linux.tar.gz @@ -70,13 +69,13 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install Eigen run: sudo VIRTUAL_ENV=/usr/local ./scripts/install-eigen.sh RelWithDebInfo - name: Download - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: qpalm-linux path: package @@ -111,7 +110,7 @@ jobs: steps: - name: Download - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: qpalm-linux path: package diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index b2485ec2..8ac1381d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -15,7 +15,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install Ninja @@ -45,7 +45,7 @@ jobs: -D CPACK_INSTALL_CMAKE_PROJECTS=".;QPALM;ALL;/;LADEL;LADEL;ALL;/" working-directory: package - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: qpalm-macos path: package/QPALM-*.tar.gz @@ -55,7 +55,7 @@ jobs: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install Ninja @@ -63,7 +63,7 @@ jobs: - name: Install Eigen run: sudo VIRTUAL_ENV=/opt/local ./scripts/install-eigen.sh RelWithDebInfo - name: Download - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: qpalm-macos path: package @@ -105,7 +105,7 @@ jobs: steps: - name: Download - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: qpalm-macos path: package diff --git a/.github/workflows/matlab.yml b/.github/workflows/matlab.yml index 62a4d13b..81d0a6dc 100644 --- a/.github/workflows/matlab.yml +++ b/.github/workflows/matlab.yml @@ -18,7 +18,7 @@ jobs: TOOLS_VERSION: '0.1.0-beta3' TOOLS_URL: 'https://github.com/tttapa/cross-python/releases/download' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Set up MATLAB @@ -26,7 +26,6 @@ jobs: with: release: R2020a - name: Download toolchain - if: steps.cache-tools.outputs.cache-hit != 'true' run: wget "${{ env.TOOLS_URL }}/${{ env.TOOLS_VERSION }}/full-${{ env.HOST }}.tar.xz" -O- | sudo tar xJ -C /opt - name: Configure run: | @@ -59,7 +58,7 @@ jobs: zip -r ../qpalm-matlab-linux.zip ./* working-directory: staging - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: qpalm-matlab-linux path: qpalm-matlab-linux.zip @@ -72,7 +71,7 @@ jobs: build-macos: runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Set up MATLAB @@ -104,7 +103,7 @@ jobs: zip -r ../qpalm-matlab-macos.zip ./* working-directory: staging - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: qpalm-matlab-macos path: qpalm-matlab-macos.zip @@ -117,7 +116,7 @@ jobs: build-windows: runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Set up MATLAB @@ -149,7 +148,7 @@ jobs: run: | Compress-Archive -Path staging\* qpalm-matlab-windows.zip - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: qpalm-matlab-windows path: qpalm-matlab-windows.zip diff --git a/.github/workflows/toolchain/action.yml b/.github/workflows/toolchain/action.yml index 1a8976bb..ec1997e7 100644 --- a/.github/workflows/toolchain/action.yml +++ b/.github/workflows/toolchain/action.yml @@ -40,7 +40,7 @@ runs: # Cache - name: Cache tools id: cache-tools - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: /opt key: ${{ runner.os }}-${{ inputs.pypy }}${{ inputs.python-version }}-${{ inputs.host }}-tools-${{ inputs.tools-version }}-${{ inputs.cmake-version }} diff --git a/.github/workflows/wheel-short-test.yml b/.github/workflows/wheel-short-test.yml index 25389207..416f62ca 100644 --- a/.github/workflows/wheel-short-test.yml +++ b/.github/workflows/wheel-short-test.yml @@ -28,7 +28,7 @@ jobs: # Git clone - name: Install git run: apt -y update && apt -y install --no-install-recommends git ca-certificates - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive # Tools @@ -42,7 +42,7 @@ jobs: - name: Prepare ccache directory run: mkdir -p "${{ env.CCACHE_DIR }}" - name: Cache ccache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.CCACHE_DIR }} key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.HOST }}-${{ matrix.config }}-ccache-${{ github.run_id }} @@ -71,7 +71,7 @@ jobs: CXXFLAGS: "-fstack-protector-all -mshstk -fcf-protection=full -D_FORTIFY_SOURCE=${{ matrix.config != 'Debug' && '3' || '0' }} -fdiagnostics-color -static-libgcc -static-libstdc++" # Upload - name: Upload Wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: whl-${{ env.PYTHON_VERSION }}-${{ matrix.config }}-linux-test retention-days: 1 @@ -85,10 +85,10 @@ jobs: matrix: config: [RelWithDebInfo, Debug] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: whl-${{ env.PYTHON_VERSION }}-${{ matrix.config }}-linux-test path: dist diff --git a/.github/workflows/wheel-upload.yml b/.github/workflows/wheel-upload.yml index 5b4d8f03..5da989e4 100644 --- a/.github/workflows/wheel-upload.yml +++ b/.github/workflows/wheel-upload.yml @@ -25,7 +25,7 @@ jobs: # Git clone - name: Install git run: apt -y update && apt -y install --no-install-recommends git ca-certificates - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive # Tools @@ -39,7 +39,7 @@ jobs: - name: Prepare ccache directory run: mkdir -p "${{ env.CCACHE_DIR }}" - name: Cache ccache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.CCACHE_DIR }} key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.HOST }}-ccache-${{ github.run_id }} @@ -64,7 +64,7 @@ jobs: tar cf stubs.tar -C "$PWD/staging" QPALM/interfaces/python # Upload - name: Upload stubs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: stubs retention-days: 1 @@ -106,7 +106,7 @@ jobs: # Git clone - name: Install git run: apt -y update && apt -y install --no-install-recommends git ca-certificates - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive # Tools @@ -121,7 +121,7 @@ jobs: - name: Prepare ccache directory run: mkdir -p "${{ env.CCACHE_DIR }}" - name: Cache ccache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.CCACHE_DIR }} key: ${{ runner.os }}-${{ matrix.pypy }}${{ matrix.python-version }}-${{ matrix.host }}-ccache-${{ github.run_id }} @@ -131,7 +131,7 @@ jobs: run: python${{ matrix.python-version }} -m pip install -U pip build pybind11-stubgen~=0.16.2 py-build-cmake~=0.2.0a7 # Download stubs - name: Download stubs - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: stubs - name: Extract stubs @@ -161,15 +161,15 @@ jobs: CXXFLAGS: '-static-libgcc -static-libstdc++' # Upload - name: Upload Wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: whl-linux + name: 'whl-linux-${{ matrix.host }}-${{ matrix.pypy }}${{ matrix.python-version }}' retention-days: 1 path: dist/*.whl - name: Upload debug Wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: whl-debug-linux + name: 'whl-debug-linux-${{ matrix.host }}-${{ matrix.pypy }}${{ matrix.python-version }}' retention-days: 1 path: dist-debug/*.whl @@ -184,7 +184,7 @@ jobs: # Git clone - name: Install git run: apt -y update && apt -y install --no-install-recommends git ca-certificates - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive # Tools @@ -218,7 +218,7 @@ jobs: CXXFLAGS: '-static-libgcc -static-libstdc++' # Upload - name: Upload source - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: src-dist retention-days: 1 @@ -232,13 +232,14 @@ jobs: matrix: python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: whl-linux + pattern: whl-linux-* path: dist + merge-multiple: true - name: Test run: | python3 -m pip install -U pip cmake ninja @@ -252,30 +253,30 @@ jobs: strategy: matrix: arch: ['AMD64', 'ARM64', 'x86'] - python-id: ['cp37-*', 'cp38-*', 'cp39-*', 'cp310-*', 'cp311-*', 'cp312-*'] + python-id: ['cp37', 'cp38', 'cp39', 'cp310', 'cp311', 'cp312'] include: - arch: 'AMD64' - python-id: 'pp38-*' + python-id: 'pp38' - arch: 'AMD64' - python-id: 'pp39-*' + python-id: 'pp39' - arch: 'AMD64' - python-id: 'pp310-*' + python-id: 'pp310' exclude: - arch: 'ARM64' - python-id: 'cp37-*' + python-id: 'cp37' - arch: 'ARM64' - python-id: 'cp38-*' + python-id: 'cp38' env: CXXFLAGS: "/bigobj" CFLAGS: "/bigobj" PYTHONUTF8: 1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Cache dependencies id: cache-dep - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: deps key: deps-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('scripts/install-eigen.ps1') }} @@ -291,7 +292,7 @@ jobs: # Download stubs - name: Download stubs if: ${{ matrix.arch == 'ARM64' }} - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: stubs - name: Extract stubs @@ -302,14 +303,14 @@ jobs: with: output-dir: dist env: - CIBW_BUILD: ${{ matrix.python-id }} + CIBW_BUILD: "${{ matrix.python-id }}-*" CIBW_ARCHS: ${{ matrix.arch }} CIBW_TEST_SKIP: "*-{win32,win_arm64} pp*" # no SciPy binaries CMAKE_PREFIX_PATH: ${{ github.workspace }}/deps - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: whl-windows + name: 'whl-windows-${{ matrix.arch }}-${{ matrix.python-id }}' retention-days: 1 path: dist/*.whl @@ -325,10 +326,10 @@ jobs: CCACHE_DIR: /tmp/.ccache MACOSX_DEPLOYMENT_TARGET: '10.9' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 id: python name: Install Python with: @@ -338,14 +339,14 @@ jobs: - name: Prepare ccache directory run: mkdir -p "${{ env.CCACHE_DIR }}" - name: Cache ccache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ env.CCACHE_DIR }} key: ${{ runner.os }}-${{ matrix.python-version }}-ccache-${{ github.run_id }} restore-keys: ${{ runner.os }}-${{ matrix.python-version }}-ccache - name: Cache Virtual Environment id: cache-venv - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: py-venv key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ hashFiles('scripts/install-eigen.sh') }} @@ -364,9 +365,9 @@ jobs: ARCHFLAGS='-arch arm64 -arch x86_64' \ python -m build -w . - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: whl-macos + name: 'whl-macos-${{ matrix.python-version }}' retention-days: 1 path: dist/*.whl @@ -377,17 +378,18 @@ jobs: matrix: python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 name: Install Python with: python-version: ${{ matrix.python-version }} - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: whl-macos + pattern: whl-macos-* path: dist + merge-multiple: true - name: Test run: | python3 -m pip install -U pip @@ -401,11 +403,12 @@ jobs: runs-on: ubuntu-latest container: python:3.11-bullseye steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: - name: whl-linux + pattern: whl-linux-* path: dist + merge-multiple: true - name: Install package run: python -m pip install --no-deps --no-index --find-links=dist ${PACKAGE_NAME}==${PACKAGE_VERSION} - name: Check package version @@ -423,25 +426,29 @@ jobs: permissions: id-token: write # mandatory for trusted publishing steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: whl-linux + pattern: whl-linux-* path: dist - - uses: actions/download-artifact@v3 + merge-multiple: true + - uses: actions/download-artifact@v4 with: - name: whl-debug-linux + pattern: whl-debug-linux-* path: dist - - uses: actions/download-artifact@v3 + merge-multiple: true + - uses: actions/download-artifact@v4 with: - name: whl-windows + pattern: whl-windows-* path: dist - - uses: actions/download-artifact@v3 + merge-multiple: true + - uses: actions/download-artifact@v4 with: - name: whl-macos + pattern: whl-macos-* path: dist - - uses: actions/download-artifact@v3 + merge-multiple: true + - uses: actions/download-artifact@v4 with: name: src-dist path: dist - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e + uses: pypa/gh-action-pypi-publish@81e9d935c883d0b210363ab89cf05f3894778450 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e39aba1a..01cd4d51 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -15,7 +15,7 @@ jobs: runs-on: windows-2022 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install Eigen @@ -49,7 +49,7 @@ jobs: -G "ZIP" working-directory: package - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: qpalm-windows path: package/QPALM-*-win64.zip @@ -59,7 +59,7 @@ jobs: runs-on: windows-2022 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install Eigen @@ -68,7 +68,7 @@ jobs: env: VIRTUAL_ENV: Eigen-install - name: Download - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: qpalm-windows path: package @@ -112,7 +112,7 @@ jobs: steps: - name: Download - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: qpalm-windows path: package