mirror of
https://github.com/containers/youki
synced 2024-05-05 23:26:32 +02:00
114 lines
3.6 KiB
YAML
114 lines
3.6 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
rust: [stable]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target/
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
override: true
|
|
- run: rustup component add rustfmt clippy
|
|
- run: sudo apt-get -y update
|
|
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev
|
|
- name: Check formatting
|
|
run: cargo fmt --all -- --check
|
|
- uses: actions-rs/clippy-check@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
args: --all-targets --all-features -- -D warnings
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
rust: [1.54.0]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target/
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
- run: sudo apt-get -y update
|
|
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev
|
|
- name: Build
|
|
run: ./build.sh --release
|
|
- name: Run tests
|
|
run: cargo test
|
|
env:
|
|
CARGO_INCREMENTAL: '0'
|
|
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
|
|
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
|
|
- name: Run doc tests
|
|
run: cargo test --doc
|
|
- name: Run cgroup tests
|
|
working-directory: cgroups
|
|
run: cargo test
|
|
env:
|
|
CARGO_INCREMENTAL: '0'
|
|
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
|
|
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
|
|
- name: Coverage
|
|
uses: actions-rs/grcov@v0.1
|
|
with:
|
|
config: .github/grcov.yml
|
|
- name: Upload Results
|
|
uses: codecov/codecov-action@v2
|
|
integration_tests:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
rust: [1.54.0]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
submodules: recursive
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
target/
|
|
integration_test/src/github.com/opencontainers/
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ matrix.rust }}
|
|
- run: sudo apt-get -y update
|
|
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev
|
|
- name: Build
|
|
run: ./build.sh --release
|
|
- uses: actions/setup-go@v2
|
|
with:
|
|
go-version: "1.11.0"
|
|
- name: Run intetgration tests
|
|
run: ./integration_test.sh
|