1
0
Fork 0
mirror of https://github.com/containers/youki synced 2024-06-01 20:36:12 +02:00
youki/.github/workflows/main.yml

130 lines
4.1 KiB
YAML
Raw Normal View History

2021-04-04 03:54:09 +02:00
on:
push:
2021-04-04 03:54:09 +02:00
branches:
- main
pull_request:
2021-04-04 03:54:09 +02:00
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: |
.: 'src/*'
./test_framework: test_framework/*
./youki_integration_test: youki_integration_test/*
check:
needs: changes
2021-07-11 09:20:53 +02:00
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable]
dirs: ${{ fromJSON(needs.changes.outputs.dirs) }}
2021-07-11 09:20:53 +02:00
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
2021-07-11 09:20:53 +02:00
- name: Check formatting
run: cargo fmt --all -- --check
working-directory: ${{matrix.dirs}}
- name: Check clippy lints
working-directory: ${{matrix.dirs}}
run: cargo clippy --all-targets --all-features -- -D warnings
2021-04-29 10:34:23 +02:00
tests:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.54.0]
steps:
- uses: actions/checkout@v2
2021-06-18 15:49:40 +02:00
- 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 }}
2021-08-31 12:36:42 +02:00
override: true
- run: sudo apt-get -y update
2021-08-24 11:33:12 +02:00
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev
2021-04-29 10:34:23 +02:00
- name: Build
2021-07-31 10:33:59 +02:00
run: ./build.sh --release
2021-04-29 10:34:23 +02:00
- name: Run tests
run: cargo test --no-fail-fast
# 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"
2021-07-05 22:42:58 +02:00
- name: Run doc tests
run: cargo test --doc
2021-08-11 19:13:07 +02:00
- name: Run cgroup tests
working-directory: cgroups
run: cargo test --no-fail-fast
# 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
2021-04-29 10:34:23 +02:00
integration_tests:
2021-04-04 03:54:09 +02:00
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.54.0]
2021-04-04 03:54:09 +02:00
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
2021-06-18 15:49:40 +02:00
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
2021-08-18 11:02:22 +02:00
integration_test/src/github.com/opencontainers/
2021-06-18 15:49:40 +02:00
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- run: sudo apt-get -y update
2021-08-24 11:33:12 +02:00
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-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
run: ./integration_test.sh