2023-05-12 08:16:24 +00:00
|
|
|
name: Build and test on Ubuntu
|
2019-08-31 09:04:46 +00:00
|
|
|
|
2023-05-12 09:00:47 +00:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- ".github/workflows/images-*"
|
2023-05-12 09:12:18 +00:00
|
|
|
- ".github/workflows/debian-cache.yml"
|
2023-05-16 12:06:59 +00:00
|
|
|
- ".github/workflows/e2e.yml"
|
2023-05-12 09:00:47 +00:00
|
|
|
pull_request:
|
2019-08-31 09:04:46 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2020-01-05 07:21:39 +00:00
|
|
|
name: Build on Ubuntu
|
2019-08-31 09:04:46 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: go build
|
|
|
|
|
2019-12-26 06:12:42 +00:00
|
|
|
test-unit:
|
|
|
|
name: Unit Testing
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
|
2019-08-31 09:04:46 +00:00
|
|
|
- name: Install dependencies for tests
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2023-01-24 15:32:04 +00:00
|
|
|
sudo apt-get install qemu-system-x86
|
2019-08-31 09:04:46 +00:00
|
|
|
|
|
|
|
- name: Bootstrap
|
2023-04-09 14:16:29 +00:00
|
|
|
run: ./tools/qemu-ubuntu-img/bootstrap.sh
|
2019-08-31 09:04:46 +00:00
|
|
|
|
2019-12-26 06:12:42 +00:00
|
|
|
- name: Unit Testing
|
2023-05-12 19:34:55 +00:00
|
|
|
run: |
|
|
|
|
mkdir ~/.out-of-tree
|
|
|
|
go test -parallel 1 -v ./...
|
2019-12-26 06:12:42 +00:00
|
|
|
|
2023-05-10 10:25:19 +00:00
|
|
|
test-end-to-end-examples:
|
2023-05-10 10:20:15 +00:00
|
|
|
name: E2E Testing (Examples)
|
2019-12-26 06:12:42 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-05-16 18:45:59 +00:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
example: [
|
2023-05-16 19:12:03 +00:00
|
|
|
{ dir: "kernel-module", params: "" },
|
|
|
|
{ dir: "kernel-exploit", params: "--threshold=0" },
|
|
|
|
{ dir: "script", params: "" },
|
|
|
|
{ dir: "preload", params: "" }
|
2023-05-16 18:45:59 +00:00
|
|
|
]
|
|
|
|
|
2019-12-26 06:12:42 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: go build
|
|
|
|
|
|
|
|
- name: Install dependencies for tests
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2023-01-24 15:32:04 +00:00
|
|
|
sudo apt-get install qemu-system-x86
|
2019-12-26 06:12:42 +00:00
|
|
|
|
2023-05-16 19:12:03 +00:00
|
|
|
- name: End-to-End Testing [${{ matrix.example.dir }}]
|
2023-05-10 10:20:15 +00:00
|
|
|
run: |
|
2023-05-16 18:50:39 +00:00
|
|
|
cd examples/${{ matrix.example.dir }}
|
2023-05-10 10:20:15 +00:00
|
|
|
../../out-of-tree --log-level=debug kernel autogen --max=1
|
2023-05-16 19:03:30 +00:00
|
|
|
../../out-of-tree --log-level=debug pew --qemu-timeout=10m ${{ matrix.example.params }}
|
2023-05-10 10:20:15 +00:00
|
|
|
|
2023-04-06 20:14:36 +00:00
|
|
|
- name: Archive logs
|
2023-05-12 07:59:58 +00:00
|
|
|
if: always()
|
2023-04-06 20:14:36 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-05-10 10:25:19 +00:00
|
|
|
name: test-end-to-end-examples-logs
|
|
|
|
path: /home/runner/.out-of-tree/logs
|