Skip to content

Commit

Permalink
build: add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
abertschi committed Apr 19, 2024
1 parent 7f938e1 commit 690d6aa
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
on:
push:
branches:
- master

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

name: build-heckler-userspace
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
run: |
sudo apt install -y python3 python3-pip python3-venv
./misc/ci.sh
67 changes: 67 additions & 0 deletions misc/ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash
set -euo pipefail

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
root_dir=$script_dir/../

#
# simple ci for some basic tests
#

function check_pgm() {
local pgm=$1

if ! command -v $pgm &> /dev/null
then
echo "$pgm could not be found"
exit 1
fi
}


function ssh() {
cd $root_dir/userspace/ssh
make
}

function sudo() {
cd $root_dir/userspace/sudo
make

}

function kernel() {
set -x
source $root_dir/stable-commits

mkdir -p $root_dir/linux/host
git clone --depth 1 -b $KERNEL_HOST_BRANCH $KERNEL_GIT_URL $root_dir/linux/host || true
cd $root_dir/linux/host
make headers
}

function attack() {
set -x
cd $root_dir/userspace/sev-step
make

cd $root_dir/userspace/heckler_bindings
make

cd $root_dir/userspace/attack
make

make test
}

check_pgm python
check_pgm make
check_pgm gcc


ssh
sudo
kernel
attack


0 comments on commit 690d6aa

Please sign in to comment.