-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (100 loc) · 3 KB
/
ci.yml
File metadata and controls
121 lines (100 loc) · 3 KB
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
113
114
115
116
117
118
119
120
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
# Check code formatting
fmt:
name: Format Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
# Run Clippy linter
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
# Run tests
test:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable]
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
- name: Run tests
run: cargo test --verbose
# Build release binaries
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: mongo-to-sqlite
asset_name: mongo-to-sqlite-linux-amd64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: mongo-to-sqlite.exe
asset_name: mongo-to-sqlite-windows-amd64.exe
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: mongo-to-sqlite
asset_name: mongo-to-sqlite-macos-amd64
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: mongo-to-sqlite
asset_name: mongo-to-sqlite-macos-arm64
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
- name: Build release
run: cargo build --release --target ${{ matrix.target }} --verbose
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
# Check documentation builds
doc:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build documentation
run: cargo doc --no-deps --all-features
- name: Check for broken links in docs
run: |
cargo install mdbook-linkcheck || true
find docs -name "*.md" -type f