Skip to content

Add build and test jobs, add manual trigger of workflows and add test… #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
167 changes: 167 additions & 0 deletions .github/workflows/qa_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
name: QA Test
on:
- pull_request
- workflow_dispatch

permissions:
contents: read

jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Build with test flag
run: |
make TEST_FLAG=-DTESTING
ls
- run: |
mkdir artifacts
- uses: actions/upload-artifact@master
with:
name: build-artifacts
path: |
*.so
*.so.*


cpu-test:
name: CPU Test
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@master
with:
name: build-artifacts
- name: Run CPU tests
run: |
./tests/CPU/cpu.sh
- uses: actions/upload-artifact@master
if: failure()
with:
name: run-artifacts
path: |
tests/CPU/cpu_info.orig
tests/CPU/cpu_info.txt

vm-test:
name: VM Test
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@master
with:
name: build-artifacts
- name: Run VM tests
run: |
./tests/VM/vm.sh
- uses: actions/upload-artifact@master
if: failure()
with:
name: run-artifacts
path: |
tests/VM/vm_info.orig
tests/VM/vm_info.txt

mem-test:
name: MEM Test
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@master
with:
name: build-artifacts
- name: Run MEM tests
run: |
./tests/MEM/mem.sh
- uses: actions/upload-artifact@master
if: failure()
with:
name: run-artifacts
path: |
tests/MEM/mem_info.orig
tests/MEM/mem_info.txt

fs-test:
name: FS Test
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@master
with:
name: build-artifacts
- name: Run FS tests
run: |
./tests/FS/fs.sh
- uses: actions/upload-artifact@master
if: failure()
with:
name: run-artifacts
path: |
tests/FS/fs_info.orig
tests/FS/fs_info.txt

#route-test:
# name: Route Test
# runs-on: ubuntu-20.04
# needs: build
# steps:
# - uses: actions/checkout@v3
# - uses: actions/download-artifact@master
# with:
# name: build-artifacts
# - name: Run Route tests
# run: |
# ./tests/ROUTE/route.sh
# - uses: actions/upload-artifact@master
# if: failure()
# with:
# name: run-artifacts
# path: |
# tests/ROUTE/route_info.orig
# tests/ROUTE/route_info.txt

#arp-test:
# name: ARP Test
# runs-on: ubuntu-20.04
# needs: build
# steps:
# - uses: actions/checkout@v3
# - uses: actions/download-artifact@master
# with:
# name: build-artifacts
# - name: Run ARP tests
# run: |
# ./tests/ARP/arp.sh
# - uses: actions/upload-artifact@master
# if: failure()
# with:
# name: run-artifacts
# path: |
# tests/ARP/arp_info.orig
# tests/ARP/arp_info.txt

stat-test:
name: STAT Test
runs-on: ubuntu-20.04
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@master
with:
name: build-artifacts
- name: Run STAT tests
run: |
./tests/STAT/stat.sh
- uses: actions/upload-artifact@master
if: failure()
with:
name: run-artifacts
path: |
tests/STAT/stat_info.orig
tests/STAT/stat_info.txt
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ CP = cp
ABI_MAJOR=0
ABI_MINOR=1
ABI_MICRO=1
TEST_FLAG=
ABI=$(ABI_MAJOR).$(ABI_MINOR).$(ABI_MICRO)
LIB = libresource.so.$(ABI)

%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS)
$(CC) -c -o $@ $< $(CFLAGS) $(TEST_FLAG)

all: $(OBJ)
$(CC) -shared -Wl,-soname,libresource.so.$(ABI_MAJOR) -o $(LIB) $^ $(CFLAGS)
$(CC) -shared -Wl,-soname,libresource.so.$(ABI_MAJOR) -o $(LIB) $^ $(CFLAGS) $(TEST_FLAG)
ln -s ./libresource.so.$(ABI) ./libresource.so
ln -s ./libresource.so.$(ABI) ./libresource.so.${ABI_MAJOR}

Expand Down