Skip to content

Commit 89cdd2b

Browse files
authored
Merge pull request #5 from roteiro-gis/ian/dev
Add GitHub Actions CI
2 parents 722b80b + c2bb227 commit 89cdd2b

4 files changed

Lines changed: 111 additions & 315 deletions

File tree

.github/workflows/ci.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
tags:
7+
- "v*"
8+
- "copc-core-v*"
9+
- "copc-reader-v*"
10+
- "copc-writer-v*"
11+
pull_request:
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: ci-${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
env:
21+
CARGO_TERM_COLOR: always
22+
RUSTFLAGS: -D warnings
23+
24+
jobs:
25+
checks:
26+
name: Checks
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Install Rust
34+
uses: dtolnay/rust-toolchain@stable
35+
with:
36+
components: rustfmt, clippy
37+
38+
- name: Cache Rust artifacts
39+
uses: Swatinem/rust-cache@v2
40+
41+
- name: Check formatting
42+
run: cargo fmt --all -- --check
43+
44+
- name: Run Clippy
45+
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
46+
47+
- name: Run tests
48+
run: cargo test --workspace --all-features
49+
50+
docs:
51+
name: Documentation
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
58+
- name: Install Rust
59+
uses: dtolnay/rust-toolchain@stable
60+
61+
- name: Cache Rust artifacts
62+
uses: Swatinem/rust-cache@v2
63+
64+
- name: Build documentation
65+
run: cargo doc --workspace --no-deps
66+
env:
67+
RUSTDOCFLAGS: -D warnings
68+
69+
msrv:
70+
name: MSRV
71+
runs-on: ubuntu-latest
72+
73+
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
77+
- name: Install Rust
78+
uses: dtolnay/rust-toolchain@1.77
79+
80+
- name: Cache Rust artifacts
81+
uses: Swatinem/rust-cache@v2
82+
83+
- name: Check workspace
84+
run: cargo check --workspace --all-targets --locked
85+
86+
package:
87+
name: Packaging
88+
runs-on: ubuntu-latest
89+
90+
steps:
91+
- name: Checkout
92+
uses: actions/checkout@v4
93+
94+
- name: Install Rust
95+
uses: dtolnay/rust-toolchain@stable
96+
97+
- name: Cache Rust artifacts
98+
uses: Swatinem/rust-cache@v2
99+
100+
- name: Fetch dependencies
101+
run: cargo fetch --locked
102+
103+
- name: Verify crate packages
104+
run: cargo package --workspace --locked
105+
106+
- name: Verify publish dry run
107+
run: cargo publish --workspace --dry-run --locked

0 commit comments

Comments
 (0)