summaryrefslogtreecommitdiff
path: root/.github/workflows/build_and_test.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/build_and_test.yml')
-rw-r--r--.github/workflows/build_and_test.yml59
1 files changed, 59 insertions, 0 deletions
diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml
new file mode 100644
index 00000000..5fe1eb25
--- /dev/null
+++ b/.github/workflows/build_and_test.yml
@@ -0,0 +1,59 @@
+name: CLBlast build
+
+on:
+ pull_request: {}
+ push:
+ branches: ['master']
+
+jobs:
+
+ build_and_test:
+ strategy:
+ matrix:
+ config: [
+ {os: ubuntu-latest, c_compiler: gcc, cpp_compiler: g++},
+ {os: ubuntu-latest, c_compiler: clang, cpp_compiler: clang++},
+ {os: macos-latest, c_compiler: clang, cpp_compiler: clang++},
+ ]
+ runs-on: ${{ matrix.config.os }}
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Install requirements for Ubuntu
+ run: |
+ sudo apt-get update
+ sudo apt-get install -yq cmake ninja-build ocl-icd-opencl-dev opencl-c-headers libopenblas-dev --no-install-recommends
+ if: ${{ matrix.config.os == 'ubuntu-latest' }}
+
+ - name: Install requirements for macOS
+ run: brew install ninja
+ if: ${{ matrix.config.os == 'macos-latest' }}
+
+ - name: Run CMake
+ run: |
+ export CC=${{ matrix.config.c_compiler }}
+ export CXX=${{ matrix.config.cpp_compiler }}
+ cmake -S . -B build -G Ninja -DTESTS=ON -DCLIENTS=ON -DSAMPLES=ON
+
+ - name: Compile the code
+ run: cmake --build build
+
+ - name: Get the diagnostics info
+ run: ./build/clblast_test_diagnostics
+ if: ${{ matrix.config.os == 'macos-latest' }}
+
+ - name: Run an example client
+ run: ./build/clblast_client_xgemm
+ if: ${{ matrix.config.os == 'macos-latest' }}
+
+ - name: Run an example sample program
+ run: ./build/clblast_sample_dgemv_c
+ if: ${{ matrix.config.os == 'macos-latest' }}
+
+ - name: Run an example tuner
+ run: ./build/clblast_tuner_xdot
+ if: ${{ matrix.config.os == 'macos-latest' }}
+
+ - name: Run the unittests
+ run: ctest --test-dir build
+ if: ${{ matrix.config.os == 'macos-latest' }}