From 030ff55042c519f422742d506f138f5242026ea7 Mon Sep 17 00:00:00 2001 From: Marco Barbone Date: Fri, 14 Jun 2024 11:54:13 -0400 Subject: [PATCH] fixed workflows --- .github/workflows/generate_matrix.py | 6 +++--- .github/workflows/python_cmake.yml | 25 ++++++++++++++++++------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/generate_matrix.py b/.github/workflows/generate_matrix.py index 0c1b3e35a..ecfeb39e4 100644 --- a/.github/workflows/generate_matrix.py +++ b/.github/workflows/generate_matrix.py @@ -4,13 +4,12 @@ "include": [] } -platforms = ["windows-latest", "macos-latest", "ubuntu-latest"] python_versions = ["3.8", "3.11"] combinations = { "ubuntu-latest": { "compiler": ["llvm", "gcc"], - "arch_flags": ["-march=native", "-march=x86-64", ""] + "arch_flags": ["-march=native", "-march=x86-64"] }, "windows-latest": { "compiler": ["msvc"], @@ -18,7 +17,7 @@ }, "macos-latest": { "compiler": ["llvm", "gcc"], - "arch_flags": ["-march=native", "-march=x86-64", ""] + "arch_flags": ["-march=native", "-march=x86-64"] } } @@ -32,5 +31,6 @@ "compiler": compiler, "arch_flags": arch_flag }) + json_str = json.dumps(matrix, ensure_ascii=False) print(json_str) diff --git a/.github/workflows/python_cmake.yml b/.github/workflows/python_cmake.yml index e0930d57e..e329d3dd1 100644 --- a/.github/workflows/python_cmake.yml +++ b/.github/workflows/python_cmake.yml @@ -5,6 +5,8 @@ on: [push, pull_request] jobs: prepare: runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.generate_matrix.outputs.matrix }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -21,12 +23,18 @@ jobs: fail-fast: false matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} steps: - - uses: actions/checkout@v4 - name: Set min macOS version and install fftw and libomp if: runner.os == 'macOS' run: | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" echo "MACOS_DEPLOYMENT_TARGET=10.14" >> $GITHUB_ENV + echo "HOMEBREW_NO_AUTO_UPDATE=1" >> $GITHUB_ENV + if [ -f /usr/local/bin/brew ]; then + echo "PATH=/usr/local/bin:$PATH" >> $GITHUB_ENV + endif + if [ -f /opt/homebrew/bin/brew ]; then + echo "PATH=/opt/homebrew/bin:$PATH" >> $GITHUB_ENV + endif brew install fftw libomp - uses: actions/setup-python@v5 with: @@ -42,16 +50,19 @@ jobs: cppcheck: false clangtidy: false - name: Install pytest - run: python -m pip install pytest + run: | + python3 -m pip install --upgrade pip + python3 -m pip install pytest - name: Install fftw and libomp if: runner.os == 'linux' run: | - sudo apt-get update - sudo apt-get install -y libfftw3-dev libomp-dev + apt-get update + apt install build-essential + apt-get install -y libfftw3-dev libomp-dev - name: Set compiler flags run: | - echo MAKE_ARGS="-DFINUFFT_ARCH_FLAGS=${{ matrix.arch_flags }}" >> $GITHUB_ENV + echo CMAKE_ARGS="-DFINUFFT_ARCH_FLAGS=${{ matrix.arch_flags }}" >> $GITHUB_ENV - name: Build - run: pip install . --verbose + run: python3 -m pip install . --verbose - name: Test - run: python -m pytest python/finufft/test + run: python3 -m pytest python/finufft/test