From 7390946e9edc2df7216eb098e9579ffd645d859e Mon Sep 17 00:00:00 2001 From: etienne-k <2804556+etienne-k@users.noreply.github.com> Date: Thu, 10 Nov 2022 21:42:05 +0100 Subject: [PATCH] Add a simple GH actions workflow --- .github/workflows/rust.yml | 64 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..cfaf7b2 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,64 @@ +name: tokio-messaging + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + CARGO_TERM_COLOR: always + CARGO_TARGET_DIR: ~/cargo-target + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Cache + uses: actions/cache@v3.0.11 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ~/cargo-target/ + key: "rust-check" + - uses: actions/checkout@v3 + - name: Check + run: cargo check + build: + runs-on: ubuntu-latest + needs: check + steps: + - name: Cache + uses: actions/cache@v3.0.11 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ~/cargo-target/ + key: "rust-build" +# TODO: not needed for now +# - uses: actions/checkout@v3 +# - name: Build +# run: cargo build + test: + runs-on: ubuntu-latest + needs: build + steps: + - name: Cache + uses: actions/cache@v3.0.11 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ~/cargo-target/ + key: "rust-build" + - uses: actions/checkout@v3 + - name: Run unit tests + run: cargo test