-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (69 loc) · 2.05 KB
/
github-actions.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: CI Workflow
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
runs-on: ubuntu-latest
container:
image: rust:latest
steps:
- uses: actions/checkout@v2
- name: Update local Rust toolchain
run: |
rustup update
rustup install nightly
rustup component add clippy rustfmt
rustup component add clippy rustfmt --toolchain nightly
- name: Get toolchain info
run: |
cargo --version --verbose
rustc --version
cargo clippy --version
- name: Install build dependencies
run: >
apt-get update &&
apt-get install -y
build-essential
cmake
libv4l-dev
nasm
- name: Lint
run: |
cargo +nightly fmt -- --check
cargo +nightly clippy --no-deps -- -D warnings
- name: Test
run: |
cargo check
cargo test --workspace -- --nocapture
- name: Build
run: |
cargo build --release
- name: Set variables for release
run: |
echo "TIMESTAMP=$(date +'%Y-%m-%d_%H:%M:%S')" >> $GITHUB_ENV
echo "RELEASE_FILE=infercam_onnx_${GITHUB_REF#refs/tags/}.tar.gz" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/')
- name: List build content
run: ls -la
if: startsWith(github.ref, 'refs/tags/')
- name: Compress release files
run: |
tar -czf ${RELEASE_FILE}
target/release/infer_server
target/release/libcam_sender*
target/release/libcommon*
target/release/libinfer_server*
target/release/multipart_sender
target/release/socket_sender
if: startsWith(github.ref, 'refs/tags/')
- name: Publish a release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@69a9b03fd9694e185b5d1450f1c534fb50ed4ab8
with:
files: |
*.tar.gz