1
0
mirror of https://github.com/containers/youki synced 2024-11-23 17:32:15 +01:00

Merge pull request #375 from YJDoc2/test_validation_workflow

Add integration tests validation workflow
This commit is contained in:
utam0k 2021-10-09 17:48:44 +09:00 committed by GitHub
commit bf4da50747
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 65 additions and 0 deletions

@ -0,0 +1,45 @@
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
changes:
runs-on: ubuntu-latest
outputs:
dirs: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
./youki_integration_test: youki_integration_test/**
validate:
needs: [changes]
if: ${{ !contains(needs.changes.outputs.dirs, '[]') }}
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.55.0, 1.54.0]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Cache youki
uses: Swatinem/rust-cache@v1
- name: Cache tests
uses: Swatinem/rust-cache@v1
with:
working-directory: ./youki_integration_test
- run: sudo apt-get -y update
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev
- name: Validate tests on runc
run: cd ./youki_integration_test && ./run_tests.sh runc
- name: Validate tests on youki
run: cd ./youki_integration_test && ./run_tests.sh ./youki

@ -1,2 +1,3 @@
/target
youki_integration_test
*.log

@ -0,0 +1,19 @@
#!/bin/bash
cd ..
./build.sh
cp ./youki ./youki_integration_test
cd ./youki_integration_test
./build.sh
RUNTIME=./youki
if [[ -n "$1" ]]; then
RUNTIME="$1"
fi
logfile="./test_log.log"
touch $logfile
sudo ./youki_integration_test -r $RUNTIME > $logfile
if [ 0 -ne $(grep "not ok" $logfile | wc -l ) ]; then
cat $logfile
exit 1
fi
echo "Validation successful for runtime $RUNTIME"