diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..52c53f8 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,29 @@ +name: Build project + +on: + push: + paths: + - "**.cpp" + - "**.hpp" + - "CMakeLists.txt" + - ".github/workflows/**/*" + - "build.sh" + +jobs: + linux: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # Set up the Intel oneAPI Docker container + - name: Set up Intel oneAPI container + uses: addnab/docker-run-action@v3 + with: + image: intel/oneapi-hpckit:latest + shell: bash + options: -v ${{ github.workspace }}:/workspace -e CI=1 --rm # Remove the container after execution + # Inside the container, run build commands + run: | + cd /workspace + bash build.sh diff --git a/build.sh b/build.sh index d848704..d03f56f 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,10 @@ set -e # Script to build the project -source /opt/intel/oneapi/setvars.sh +# check if inside CI environment +if [ ! -n "$CI" ]; then + source /opt/intel/oneapi/setvars.sh +fi # Check if script is run from root directory if [ ! -f "main.cpp" ]; then