2021-04-04 03:54:09 +02:00
|
|
|
on:
|
2021-04-04 03:44:08 +02:00
|
|
|
push:
|
2021-04-04 03:54:09 +02:00
|
|
|
branches:
|
|
|
|
- main
|
2021-04-04 03:44:08 +02:00
|
|
|
pull_request:
|
2021-04-04 03:54:09 +02:00
|
|
|
branches:
|
|
|
|
- main
|
2021-04-04 03:44:08 +02:00
|
|
|
|
|
|
|
jobs:
|
2021-09-03 08:50:49 +02:00
|
|
|
changes:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
dirs: ${{ steps.filter.outputs.changes }}
|
|
|
|
steps:
|
2021-09-05 16:39:59 +02:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: dorny/paths-filter@v2
|
|
|
|
id: filter
|
|
|
|
with:
|
|
|
|
filters: |
|
|
|
|
.: 'src/*'
|
|
|
|
./test_framework: test_framework/*
|
|
|
|
./youki_integration_test: youki_integration_test/*
|
2021-09-06 07:30:50 +02:00
|
|
|
./cgroups: cgroups/*
|
2021-08-01 09:42:06 +02:00
|
|
|
check:
|
2021-09-06 07:30:50 +02:00
|
|
|
needs: [changes]
|
2021-09-11 09:09:23 +02:00
|
|
|
if: ${{ !contains(needs.changes.outputs.dirs, '[]') }}
|
2021-07-11 09:20:53 +02:00
|
|
|
runs-on: ubuntu-latest
|
2021-08-01 09:42:06 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-09-09 17:02:19 +02:00
|
|
|
rust: [1.55.0, 1.54.0]
|
2021-09-05 16:39:59 +02:00
|
|
|
dirs: ${{ fromJSON(needs.changes.outputs.dirs) }}
|
2021-07-11 09:20:53 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-08-01 09:42:06 +02:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.rust }}
|
|
|
|
override: true
|
2021-09-07 11:08:07 +02:00
|
|
|
- name: Cache youki
|
|
|
|
uses: Swatinem/rust-cache@v1
|
2021-09-07 11:17:15 +02:00
|
|
|
- name: Cache cgroups
|
2021-09-07 11:08:07 +02:00
|
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
with:
|
|
|
|
working-directory: ./cgroups
|
2021-08-01 09:42:06 +02:00
|
|
|
- run: rustup component add rustfmt clippy
|
|
|
|
- run: sudo apt-get -y update
|
2021-09-14 08:54:35 +02:00
|
|
|
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev
|
2021-07-11 09:20:53 +02:00
|
|
|
- name: Check formatting
|
|
|
|
run: cargo fmt --all -- --check
|
2021-09-03 08:50:49 +02:00
|
|
|
working-directory: ${{matrix.dirs}}
|
2021-09-05 16:39:59 +02:00
|
|
|
- name: Check clippy lints
|
2021-09-03 08:50:49 +02:00
|
|
|
working-directory: ${{matrix.dirs}}
|
|
|
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
2021-04-29 10:34:23 +02:00
|
|
|
tests:
|
2021-04-04 03:44:08 +02:00
|
|
|
runs-on: ubuntu-latest
|
2021-08-01 09:42:06 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-09-09 17:02:19 +02:00
|
|
|
rust: [1.55.0, 1.54.0]
|
2021-04-04 03:44:08 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-08-01 09:42:06 +02:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-09-05 17:39:32 +02:00
|
|
|
toolchain: ${{ matrix.rust }}
|
2021-08-31 12:36:42 +02:00
|
|
|
override: true
|
2021-09-07 10:56:22 +02:00
|
|
|
- name: Cache youki
|
|
|
|
uses: Swatinem/rust-cache@v1
|
2021-09-07 11:17:15 +02:00
|
|
|
- name: Cache cgroups
|
2021-09-07 10:56:22 +02:00
|
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
with:
|
|
|
|
working-directory: ./cgroups
|
2021-06-06 05:50:18 +02:00
|
|
|
- run: sudo apt-get -y update
|
2021-09-14 08:54:35 +02:00
|
|
|
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev
|
2021-04-29 10:34:23 +02:00
|
|
|
- name: Run tests
|
2021-09-09 16:07:06 +02:00
|
|
|
run: cargo test --all --all-features --no-fail-fast
|
2021-09-06 07:07:39 +02:00
|
|
|
coverage:
|
|
|
|
runs-on: ubuntu-latest
|
2021-09-06 07:30:50 +02:00
|
|
|
name: Run test coverage
|
2021-09-06 07:07:39 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-09-07 10:36:39 +02:00
|
|
|
- name: Toolchain setup
|
|
|
|
uses: actions-rs/toolchain@v1
|
2021-09-06 07:07:39 +02:00
|
|
|
with:
|
2021-09-07 10:36:39 +02:00
|
|
|
toolchain: nightly
|
|
|
|
override: true
|
|
|
|
profile: minimal
|
|
|
|
components: llvm-tools-preview
|
2021-09-07 11:08:07 +02:00
|
|
|
- name: Cache youki
|
|
|
|
uses: Swatinem/rust-cache@v1
|
2021-09-07 11:17:15 +02:00
|
|
|
- name: Cache cgroups
|
2021-09-07 11:08:07 +02:00
|
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
with:
|
|
|
|
working-directory: ./cgroups
|
2021-09-06 07:07:39 +02:00
|
|
|
- name: install cargo-llvm-cov
|
2021-09-07 10:36:39 +02:00
|
|
|
env:
|
|
|
|
CARGO_LLVM_COV_VERSION: 0.1.5
|
2021-09-06 07:07:39 +02:00
|
|
|
run: |
|
|
|
|
wget https://github.com/taiki-e/cargo-llvm-cov/releases/download/v${CARGO_LLVM_COV_VERSION}/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz -qO- | tar -xzvf -
|
|
|
|
mv cargo-llvm-cov ~/.cargo/bin
|
|
|
|
- name: Update System Libraries
|
|
|
|
run: sudo apt-get -y update
|
|
|
|
- name: Install System Libraries
|
2021-09-14 08:54:35 +02:00
|
|
|
run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev
|
2021-09-06 07:30:50 +02:00
|
|
|
- name: Run Test Coverage for youki
|
2021-09-06 07:07:39 +02:00
|
|
|
run: |
|
|
|
|
cargo llvm-cov clean --workspace
|
2021-09-06 07:30:50 +02:00
|
|
|
cargo llvm-cov --no-report
|
|
|
|
cargo llvm-cov --no-run --lcov --output-path ./coverage.lcov
|
|
|
|
- name: Run Test Coverage for cgroups
|
|
|
|
working-directory: ./cgroups
|
|
|
|
run: |
|
|
|
|
cargo llvm-cov clean --workspace
|
|
|
|
cargo llvm-cov --no-report
|
|
|
|
cargo llvm-cov --no-run --lcov --output-path ./coverage.lcov
|
|
|
|
- name: Upload Youki Code Coverage Results
|
|
|
|
uses: codecov/codecov-action@v2
|
|
|
|
with:
|
|
|
|
file: ./coverage.lcov
|
|
|
|
- name: Upload Cgroups Code Coverage Results
|
2021-09-06 07:07:39 +02:00
|
|
|
uses: codecov/codecov-action@v2
|
|
|
|
with:
|
2021-09-06 07:30:50 +02:00
|
|
|
file: ./cgroups/coverage.lcov
|
2021-04-29 10:34:23 +02:00
|
|
|
integration_tests:
|
2021-04-04 03:54:09 +02:00
|
|
|
runs-on: ubuntu-latest
|
2021-08-01 09:42:06 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-09-09 17:02:19 +02:00
|
|
|
rust: [1.55.0, 1.54.0]
|
2021-04-04 03:54:09 +02:00
|
|
|
steps:
|
2021-04-04 17:17:48 +02:00
|
|
|
- uses: actions/checkout@v2
|
2021-05-27 14:24:11 +02:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2021-09-07 15:24:52 +02:00
|
|
|
- name: Cache runtime-tools
|
|
|
|
id: cache-runtime-tools
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: integration_test
|
|
|
|
key: ${{ runner.os }}-${{ matrix.rust }}-primes
|
2021-04-04 03:44:08 +02:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2021-08-01 09:42:06 +02:00
|
|
|
toolchain: ${{ matrix.rust }}
|
2021-09-07 11:08:07 +02:00
|
|
|
- name: Cache youki
|
|
|
|
uses: Swatinem/rust-cache@v1
|
2021-09-07 11:17:15 +02:00
|
|
|
- name: Cache cgroups
|
2021-09-07 11:08:07 +02:00
|
|
|
uses: Swatinem/rust-cache@v1
|
|
|
|
with:
|
|
|
|
working-directory: ./cgroups
|
2021-06-06 05:50:18 +02:00
|
|
|
- run: sudo apt-get -y update
|
2021-09-14 08:54:35 +02:00
|
|
|
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev
|
2021-06-07 14:04:28 +02:00
|
|
|
- name: Build
|
2021-07-31 10:33:59 +02:00
|
|
|
run: ./build.sh --release
|
2021-04-04 03:54:09 +02:00
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: "1.11.0"
|
2021-04-29 10:34:23 +02:00
|
|
|
- name: Run intetgration tests
|
2021-05-26 11:50:03 +02:00
|
|
|
run: ./integration_test.sh
|