-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tim Whisonant <tim.whisonant@intel.com>
- Loading branch information
Showing
4 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Build DEBs | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: [master] | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
jobs: | ||
DEB: | ||
strategy: | ||
matrix: | ||
distro: [ubuntu22] | ||
runs-on: ubuntu-latest | ||
name: Build ${{ matrix.distro }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Build Docker Image | ||
run: docker build . -f docker/${{ matrix.distro }}/Dockerfile -t opae-${{ matrix.distro }} | ||
- name: Build DEBs | ||
run: | | ||
docker run --rm -v ${{ github.workspace }}:/opae-${{ matrix.distro }}/opae-sdk opae-${{ matrix.distro }} /opae-${{ matrix.distro }}/opae-sdk | ||
- name: Install and Test DEBs | ||
if: ${{ github.event_name != 'pull_request'}} | ||
run: | | ||
docker run --rm -v ${{ github.workspace }}:/opae-${{ matrix.distro }}/opae-sdk --workdir /opae-${{ matrix.distro }}/opae-sdk --entrypoint /bin/bash opae-${{ matrix.distro }} -c "/scripts/test-debs.sh" | ||
- name: Upload Artifact | ||
if: ${{ github.event_name != 'pull_request'}} | ||
uses: actions/upload-artifact@v2.1.4 | ||
with: | ||
name: OPAE-${{ matrix.distro }} | ||
path: | ||
${{ matrix.distro }}/opae-sdk/packaging/opae/deb/*.deb | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM ubuntu:22.04 | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip python3-dev git gcc g++ make cmake uuid-dev libjson-c-dev libhwloc-dev libtbb-dev libedit-dev libudev-dev bsdmainutils devscripts debhelper dh-python | ||
RUN python3 -m pip install setuptools --upgrade --prefix=/usr | ||
RUN python3 -m pip install pyyaml jsonschema pybind11 | ||
WORKDIR /root | ||
COPY scripts/build-debs.sh /scripts/build-debs.sh | ||
COPY scripts/test-debs.sh /scripts/test-debs.sh | ||
ENTRYPOINT ["/scripts/build-debs.sh"] |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -x | ||
|
||
src=$(realpath ${1:-$PWD}) | ||
|
||
cmake=cmake | ||
if ! command -v cmake > /dev/null && command -v cmake3 > /dev/null; then | ||
cmake=cmake3 | ||
fi | ||
|
||
${src}/packaging/opae/deb/create |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
debdir=$(realpath ${1:-$PWD}) | ||
debdir="${debdir}/packaging/opae/deb" | ||
|
||
apt-get install -y $debdir/opae*.deb | ||
if [ $? -ne 0 ]; then | ||
echo "Could not install OPAE DEBs" | ||
exit 1 | ||
fi | ||
|
||
failures=0 | ||
test_exit_code(){ | ||
expected_code=$1 | ||
shift | ||
cmd="$@" | ||
echo "testing: $cmd" | ||
$cmd > output.dat | ||
actual_code=$? | ||
if [ $expected_code != $actual_code ]; then | ||
failures=$(echo 1+$failures | bc) | ||
echo "$cmd: expected $expected_code, got $actual_code" >> errors.txt | ||
cat output.dat | ||
fi | ||
} | ||
|
||
if [ -f errors.txt ]; then | ||
unlink errors.txt | ||
fi | ||
|
||
test_exit_code 0 "fpgainfo -h" | ||
test_exit_code 1 "fpgaconf -h" | ||
test_exit_code 0 "pci_device -h" | ||
test_exit_code 0 "fpgasupdate -h" | ||
test_exit_code 0 "hssi -h" | ||
test_exit_code 0 "dummy_afu -h" | ||
test_exit_code 0 "opae.io -h" | ||
test_exit_code 0 "PACSign -h" | ||
test_exit_code 1 "fpgadiag -h" | ||
test_exit_code 100 "fpgadiag -m lpbk1 -h" | ||
test_exit_code 100 "fpgadiag -m read -h" | ||
test_exit_code 100 "fpgadiag -m write -h" | ||
test_exit_code 100 "fpgadiag -m trput -h" | ||
|
||
dd if=/dev/urandom of=dummy.bin bs=1 count=1024 2> /dev/null | ||
test_exit_code 0 \ | ||
"PACSign PR -H openssl_manager -t UPDATE -y -i dummy.bin -o dummy.signed" | ||
echo "unexpected exit codes shown below" | ||
if [ -f errors.txt ]; then | ||
cat errors.txt | ||
fi | ||
echo "failures: $failures" | ||
exit $failures |