diff --git a/examples/ci.kdl b/examples/ci.kdl new file mode 100644 index 0000000..723f6bf --- /dev/null +++ b/examples/ci.kdl @@ -0,0 +1,47 @@ +// This example is a GitHub Action if it used KDL syntax. +// See .github/workflows/ci.yml for the file this was based on. +name "CI" + +on "push" "pull_request" + +env { + RUSTFLAGS "-Dwarnings" +} + +jobs { + fmt_and_docs "Check fmt & build docs" { + runs-on "ubuntu-latest" + steps { + step uses="actions/checkout@v1" + step "Install Rust" uses="actions-rs/toolchain@v1" { + profile "minimal" + toolchain "stable" + components "rustfmt" + override true + } + step "rustfmt" run="cargo fmt --all -- --check" + step "docs" run="cargo doc --no-deps" + } + } + build_and_test "Build & Test" { + runs-on "${{ matrix.os }}" + strategy { + matrix { + rust "1.46.0" "stable" + os "ubuntu-latest", "macOS-latest", "windows-latest" + } + } + + steps { + step uses="actions/checkout@v1" + step "Install Rust" uses="actions-rs/toolchain@v1" { + profile "minimal" + toolchain "${{ matrix.rust }}" + components "clippy" + override true + } + step "Clippy" run="cargo clippy --all -- -D warnings" + step "Run tests" run="cargo test --all --verbose" + } + } +}