name: Build and test on Ubuntu on: workflow_dispatch: push: paths-ignore: - ".github/workflows/images-*" - ".github/workflows/debian-cache.yml" - ".github/workflows/e2e.yml" pull_request: jobs: build: name: Build on Ubuntu runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Build run: go build test-unit: name: Unit Testing runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: Install dependencies for tests run: | sudo apt-get update sudo apt-get install qemu-system-x86 - name: Bootstrap run: ./tools/qemu-ubuntu-img/bootstrap.sh - name: Unit Testing run: | mkdir ~/.out-of-tree go test -parallel 1 -v ./... test-end-to-end-examples: name: E2E Testing (Examples) runs-on: ubuntu-latest strategy: matrix: example: [ { name: "Kernel Module", dir: "kernel-module", params: "" }, { name: "Kernel Exploit", dir: "kernel-exploit", params: "--threshold=0" }, { name: "Script", dir: "script", params: "" }, { name: "Preload", dir: "preload", params: "" } ] steps: - uses: actions/checkout@v1 - name: Build run: go build - name: Install dependencies for tests run: | sudo apt-get update sudo apt-get install qemu-system-x86 - name: End-to-End Testing [${{ matrix.example.name }}] run: | cd examples/${{ matrix.example.dir }} ../../out-of-tree --log-level=debug kernel autogen --max=1 ../../out-of-tree --log-level=debug pew --qemu-timeout=10m cd ${{ matrix.example.params }} - name: Archive logs if: always() uses: actions/upload-artifact@v3 with: name: test-end-to-end-examples-logs path: /home/runner/.out-of-tree/logs