Update CI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
parent
141ba3bac8
commit
0ffdbc5a48
|
|
@ -9,15 +9,15 @@ jobs:
|
|||
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-18.04]
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- run: |
|
||||
sudo apt-get update -y
|
||||
# Journal example
|
||||
sudo apt-get install -y libsystemd-dev
|
||||
if: runner.os == 'Linux'
|
||||
- run: cargo check --examples --tests --all-targets
|
||||
- run: cargo fmt --all -- --check --files-with-diff
|
||||
- run: cargo clippy --all-targets --all-features -- -D warnings
|
||||
|
|
|
|||
|
|
@ -8,5 +8,5 @@ license = "Apache-2.0"
|
|||
repository = "https://github.com/mxpv/containerd-rust-extensions"
|
||||
keywords = ["containerd", "shim", "containers"]
|
||||
|
||||
[dev-dependencies]
|
||||
[target.'cfg(target_os = "linux")'.dev-dependencies]
|
||||
systemd = { version = "0.9.0", default-features = false, features = ["journal"] }
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
use std::fs;
|
||||
use std::io::{self, BufRead};
|
||||
use std::thread;
|
||||
|
||||
use containerd_shim_logging as logging;
|
||||
|
||||
use logging::{Config, Driver};
|
||||
use systemd::journal;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn pump(reader: fs::File) {
|
||||
use std::io::{self, BufRead};
|
||||
use systemd::journal;
|
||||
|
||||
io::BufReader::new(reader)
|
||||
.lines()
|
||||
.filter_map(|line| line.ok())
|
||||
|
|
@ -16,6 +18,9 @@ fn pump(reader: fs::File) {
|
|||
});
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
fn pump(_reader: fs::File) {}
|
||||
|
||||
struct Journal {
|
||||
stdout_handle: thread::JoinHandle<()>,
|
||||
stderr_handle: thread::JoinHandle<()>,
|
||||
|
|
|
|||
Loading…
Reference in New Issue