-
Notifications
You must be signed in to change notification settings - Fork 25
112 lines (81 loc) · 2.38 KB
/
continuos-integration.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: CI
on: [push, pull_request]
jobs:
fmt:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
run: |
rustup update --no-self-update stable
rustup component add rustfmt
- name: Run fmt
run: cargo fmt -- --check
clippy:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
run: |
rustup update --no-self-update stable
rustup component add clippy
- name: Run clippy
run: cargo clippy -- -D warnings
test:
strategy:
matrix:
platform: [ubuntu-22.04, windows-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install and run minio
if: matrix.platform == 'ubuntu-22.04'
run: |
MINIO_RELEASE="2021-03-26T00-00-41Z"
LINK="https://dl.min.io/server/minio/release/linux-amd64/archive/"
curl --output minio "$LINK/minio.RELEASE.$MINIO_RELEASE"
chmod +x minio
./minio server minio_data/ &
- name: Run tests
if: matrix.platform == 'ubuntu-22.04'
run: cargo test
- name: Run tests
if: matrix.platform != 'ubuntu-22.04'
run: cargo test --lib
- name: Run tests no default features
run: cargo test --lib --no-default-features
msrv:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
run: rustup default 1.67
- name: Run tests
run: cargo test --lib
coverage:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install cargo-tarpaulin
run: |
LINK="https://github.com/xd009642/tarpaulin/releases/download/0.20.1/cargo-tarpaulin-0.20.1-travis.tar.gz"
curl -L --output tarpaulin.tar.gz "$LINK"
tar -xzvf tarpaulin.tar.gz
chmod +x cargo-tarpaulin
- name: Run cargo-tarpaulin
run: ./cargo-tarpaulin tarpaulin --lib --out Xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
args: '--lib'
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: cobertura.xml