Skip to content

Commit

Permalink
Add build action
Browse files Browse the repository at this point in the history
- use Intel openAPI container to build project
- cannot run setvars inside container
  • Loading branch information
gwauge committed Dec 6, 2024
1 parent 02b7939 commit 86c7773
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 4 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 86c7773

Please sign in to comment.