Add Option for own FastSIMD path instead of always downloading it from github. #709
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| # Controls when the action will run. Triggers the workflow on push or pull request | |
| # events but only for the master branch | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master,NewFastSIMD] | |
| release: | |
| types: [published] | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| ci-matrix: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| name: Win32-MSVC | |
| cmake_options: -A Win32 | |
| - os: windows-latest | |
| name: Win64-MSVC | |
| cmake_options: -A x64 | |
| - os: windows-latest | |
| name: Win64-ClangCL | |
| cmake_options: -A x64 -T ClangCL | |
| - os: ubuntu-latest | |
| name: Linux64-GCC | |
| cmake_options: -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ | |
| - os: ubuntu-latest | |
| name: Linux64-Clang | |
| cmake_options: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ | |
| - os: macos-15-intel | |
| name: MacOS64-Clang | |
| cmake_options: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ | |
| - os: macos-latest | |
| name: MacOSARM64-Clang | |
| cmake_options: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" | |
| - os: ubuntu-latest | |
| name: Emscripten-WASM | |
| cmake_options: -G Ninja -DCMAKE_TOOLCHAIN_FILE=./toolchains/generic/Emscripten-wasm.cmake -DFASTNOISE2_TESTS=OFF -DBUILD_SHARED_LIBS=OFF | |
| steps: | |
| - name: 'Install OpenGL & xorg' | |
| if: startsWith(matrix.name, 'Linux') | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install libgl1-mesa-dev libwayland-dev libxkbcommon-dev xorg-dev | |
| - name: 'Setup Emscripten' | |
| if: matrix.name == 'Emscripten-WASM' | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: 4.0.21 | |
| - name: 'Checkout' | |
| uses: actions/checkout@v3 | |
| - name: 'Checkout toolchains' | |
| if: matrix.name == 'Emscripten-WASM' | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: mosra/toolchains | |
| ref: 01fba65ea1183b301ddc1305cf4ddb7011d9208d | |
| path: toolchains | |
| - name: 'CMake Build Debug' | |
| run: cmake -S ${{ github.workspace }} -B ${{ github.workspace }}/debug -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install/FastNoise2" -DFASTNOISE2_TOOLS=OFF -DFASTNOISE2_TESTS=OFF ${{ matrix.cmake_options }} | |
| - name: 'CMake Install Debug' | |
| run: cmake --build ${{ github.workspace }}/debug --config Debug --target install | |
| - name: 'CMake Build Release' | |
| run: cmake -S ${{ github.workspace }} -B ${{ github.workspace }}/release -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install/FastNoise2" -DFASTNOISE2_TOOLS=ON -DFASTNOISE2_TESTS=ON ${{ matrix.cmake_options }} | |
| - name: 'CMake Install Release' | |
| run: cmake --build ${{ github.workspace }}/release --config Release --target install | |
| - if: runner.os != 'Windows' && matrix.name != 'Emscripten-WASM' | |
| run: chmod +x ${{ github.workspace }}/install/FastNoise2/bin/NodeEditor | |
| - name: 'Upload artifact' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.name }} | |
| path: ${{ github.workspace }}/install/ | |
| - name: 'Zip artifacts' | |
| if: github.event_name == 'release' | |
| uses: papeloto/action-zip@v1 | |
| with: | |
| files: install/ | |
| recursive: true | |
| dest: ${{ matrix.name }}.zip | |
| - name: 'Upload release artifacts' | |
| if: github.event_name == 'release' | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: ${{ github.workspace }}/${{ matrix.name }}.zip | |
| asset_name: FastNoise2-${{ github.event.release.tag_name }}-${{ matrix.name }}.zip | |
| tag: ${{ github.ref }} | |
| deploy-wasm-preview: | |
| name: Deploy WASM Preview | |
| needs: ci-matrix | |
| if: github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: 'Download WASM artifact' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: Emscripten-WASM | |
| path: wasm-artifact | |
| - name: 'Prepare Pages content' | |
| run: | | |
| mkdir pages | |
| cp wasm-artifact/FastNoise2/bin/* pages/ | |
| mv pages/NodeEditor.html pages/index.html | |
| - name: 'Upload Pages artifact' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: pages | |
| - name: 'Deploy to GitHub Pages' | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |