-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (83 loc) · 2.43 KB
/
ci.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: ci
on:
push:
branches:
- "*"
pull_request:
branches:
- "develop"
- "main"
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 📁 Checkout
uses: actions/checkout@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: ⚡ Cache
uses: actions/cache@v3
continue-on-error: false
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
- name: 🔧 Install protoc
uses: arduino/setup-protoc@v1.1.2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: 🔨 Install tools
run: |
sudo apt update \
&& sudo apt install libssl-dev build-essential cmake pkg-config llvm-dev libclang-dev clang libmosquitto-dev libsqlite3-dev -y \
&& cargo install --locked cargo-audit || true \
&& cargo install cargo-tarpaulin --force
- name: 🔐 Run audit
run: |
cargo audit
- name: 🔎 Run tests
run: |
cargo tarpaulin --workspace --timeout 120 --skip-clean --exclude-files "examples/**/*" --out xml
- name: ☁ Codecov
uses: codecov/codecov-action@v3
with:
token: ${{secrets.CODECOV_TOKEN}}
verbose: true
tag:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: 📁 Checkout
uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: ⚙ Pre release
if: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop'}}
uses: anothrNick/github-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
WITH_V: true
PRERELEASE: true
- name: ⚙ Patch release
if: ${{ github.ref == 'refs/heads/develop' }}
uses: anothrNick/github-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: patch
WITH_V: true
PRERELEASE: true
- name: ⚙ Minor release
if: ${{ github.ref == 'refs/heads/main' }}
uses: anothrNick/github-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: minor
WITH_V: true