Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed Nov 7, 2023
1 parent fadff1d commit 6e02e26
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Copyright 2023, Colias Group, LLC
#
# SPDX-License-Identifier: BSD-2-Clause
#

* @nspin
12 changes: 12 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--
Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
SPDX-License-Identifier: CC-BY-SA-4.0
-->

# Code of Conduct

This repository and interactions with it fall under the [seL4 Code of Conduct][1] available from the [seL4 website][2].

[1]: https://docs.sel4.systems/processes/conduct.html
[2]: https://sel4.systems
44 changes: 44 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
SPDX-License-Identifier: CC-BY-SA-4.0
-->

# Contributions Welcome

Please see the [seL4 contributing guidelines][1] on the [seL4 website][2] for
details.

[1]: https://docs.sel4.systems/processes/contributing.html
[2]: https://sel4.systems


## Contact

If you have larger changes or additions, it is a good idea to get in contact
with us as <[email protected]>, so we can help you get started.

The people responsible for the technical direction, procedures, and quality
control are the [Technical Steering Committee][3] (TSC) of the seL4
foundation. You can contact them either on the developer mailing list or on
directly via email available from their profile pages.

[3]: https://sel4.systems/Foundation/TSC


## Developer Certificate of Origin (DCO)

This repository uses the same sign-off process as the Linux kernel. For every
commit, use

git commit -s

to add a sign-off line to your commit message, which will come out as:

Signed-off-by: name <email>

By adding this line, you make the declaration that you have the right to make
this contribution under the open source license the files use that you changed
or contributed.

The full text of the declaration is at <https://developercertificate.org>.
26 changes: 26 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright 2023, Colias Group, LLC
#
# SPDX-License-Identifier: BSD-2-Clause
#

name: "CI"
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
check-licenses:
name: Check licenses
runs-on: ubuntu-latest
steps:
- uses: seL4/ci-actions/license-check@master
build-and-check:
name: Build and check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and check
run: make -C docker/ test
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
# SPDX-License-Identifier: BSD-2-Clause
#

build_dir := build
BUILD ?= build

build_dir := $(BUILD)

sel4_prefix := $(SEL4_INSTALL_DIR)

Expand Down Expand Up @@ -52,10 +54,17 @@ $(image): $(app) $(loader) $(loader_cli)
--app $(app) \
-o $@

.PHONY: run
run: $(image)
qemu_cmd := \
qemu-system-aarch64 \
-machine virt,virtualization=on \
-cpu cortex-a57 -smp 2 -m 1024 \
-nographic -serial mon:stdio \
-kernel $<
-kernel $(image)

.PHONY: run
run: $(image)
$(qemu_cmd)

.PHONY: test
test: test.py $(image)
python3 $< $(qemu_cmd)
7 changes: 7 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,10 @@ rm-container:
for id in $$(docker ps -aq -f "name=^$(container_name)$$"); do \
docker rm -f $$id; \
done

.PHONY: test
test: build
docker run --rm \
--mount type=bind,readonly,src=$(abspath $(work_root)),dst=/work \
-i $(image_tag) \
make test BUILD=/tmp/build
23 changes: 23 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Copyright 2023, Colias Group, LLC
#
# SPDX-License-Identifier: BSD-2-Clause
#

import sys
import argparse
import pexpect

def main():
parser = argparse.ArgumentParser()
parser.add_argument('cmd', nargs=argparse.REMAINDER)
args = parser.parse_args()
run(args)

def run(args):
child = pexpect.spawn(args.cmd[0], args.cmd[1:], encoding='utf-8')
child.logfile = sys.stdout
child.expect('TEST_PASS', timeout=3)

if __name__ == '__main__':
main()

0 comments on commit 6e02e26

Please sign in to comment.