64 lines
1.3 KiB
YAML
64 lines
1.3 KiB
YAML
name: serial-to-tcp
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
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/
|
|
target/
|
|
key: "rust"
|
|
#key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
|
- 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/
|
|
target/
|
|
key: "rust"
|
|
- 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/
|
|
target/
|
|
key: "rust"
|
|
- uses: actions/checkout@v3
|
|
- name: Run unit tests
|
|
run: cargo test
|