Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
SoloJacobs committed Nov 7, 2023
1 parent c057976 commit c3117ac
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,23 @@ jobs:
matrix:
os: ["ubuntu-latest"]
target: ["x86_64-pc-windows-gnu", "x86_64-unknown-linux-gnu"]
step: ["cargo-fmt-check", "cargo-clippy", "cargo-test"]
step: ["cargo-fmt-check", "cargo-clippy", "cargo-test", "cargo-build"]
exclude:
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
step: cargo-test
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup environment
run: ./setup
- name: "Setup Rust"
uses: actions-rust-lang/[email protected]
with:
components: rustfmt, clippy
target: x86_64-pc-windows-gnu

- name: "Install MinGW-w64"
run: sudo apt-get install -y mingw-w64

- name: ${{ matrix.step }}
env:
STEP: ${{ matrix.step }}
run: ./ci "${STEP}"
run: ./ci ${{ matrix.step }}
9 changes: 7 additions & 2 deletions ci
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ main() {
self="${topdir}/ci"
cargo_toml_path="${topdir}/v2/robotmk/Cargo.toml"
mode="${1}"
target="${2:-x86_64-unknown-linux-gnu}"
shift

case "${mode}" in
Expand All @@ -13,11 +14,15 @@ main() {
;;

'cargo-clippy')
cargo clippy --manifest-path "${cargo_toml_path}" --all-targets -- --deny warnings
cargo clippy --manifest-path "${cargo_toml_path}" --all-targets --target "${target}" -- --deny warnings
;;

'cargo-test')
cargo test --manifest-path "${cargo_toml_path}" --all-targets
cargo test --manifest-path "${cargo_toml_path}" --all-targets --target "${target}"
;;

'cargo-build')
cargo build --manifest-path "${cargo_toml_path}" --target "${target}"
;;

'check-all')
Expand Down
5 changes: 0 additions & 5 deletions setup
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
set -e

main() {
setup_rust
git config core.hooksPath .githooks
}

setup_rust() {
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s - -y
}

main
3 changes: 3 additions & 0 deletions v2/robotmk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ path = "src/bin/agent.rs"
[[bin]]
name = "robotmk"
path = "src/bin/scheduler/main.rs"

[lib]
doctest = false

0 comments on commit c3117ac

Please sign in to comment.