This repository has been archived by the owner on Jun 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (53 loc) · 1.53 KB
/
build.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
name: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"
jobs:
build:
runs-on: self-hosted
continue-on-error: false
steps:
- uses: actions/checkout@v3
- name: Install Toolchain
run: |
rustup update stable
rustup default stable
rustup component add rustfmt
rustup component add clippy
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install Sqlite
run: |
apt update
apt install libsqlite3-dev
- name: Format check
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --all-targets --all-features
- name: Compile check
run: cargo check --all-targets --all-features
- name: Run tests and Generate code coverage
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: cargo llvm-cov --all-features --workspace --codecov --output-path lcov.info
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: lcov.info
retention-days: 3
- name: Upload to codecov
uses: codecov/codecov-action@v3
with:
token: be8874e2-10d6-434f-9d52-db6094de31d6
files: lcov.info
name: codecov-umbrella # optional
fail_ci_if_error: true
verbose: true