Skip to content

Commit

Permalink
fixed workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamonDinoia committed Jun 14, 2024
1 parent ff9dba3 commit 030ff55
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/generate_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@
"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"],
"arch_flags": ["/arch:AVX2", "/arch:AVX512", "/arch:SSE2"]
},
"macos-latest": {
"compiler": ["llvm", "gcc"],
"arch_flags": ["-march=native", "-march=x86-64", ""]
"arch_flags": ["-march=native", "-march=x86-64"]
}
}

Expand All @@ -32,5 +31,6 @@
"compiler": compiler,
"arch_flags": arch_flag
})

json_str = json.dumps(matrix, ensure_ascii=False)
print(json_str)
25 changes: 18 additions & 7 deletions .github/workflows/python_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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

0 comments on commit 030ff55

Please sign in to comment.