-
Notifications
You must be signed in to change notification settings - Fork 5
113 lines (105 loc) · 3.36 KB
/
pr-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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: "Pull Request CI"
on:
push:
branches:
- main
- release-*
- refs/tags/*
pull_request:
branches:
- "*" # Quotes required because * is reserved by YAML
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-and-test:
name: "Build and Test"
runs-on: ubuntu-latest
steps:
- name: Checkout tiledb-rs
uses: actions/checkout@v4
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: Setup Rustc Cache
uses: Swatinem/rust-cache@v2
- name: Install TileDB
uses: ./.github/actions/install-tiledb
- name: Build
run: cargo build --all-targets --all-features
- name: Test
run: |
cargo test --all-targets --all-features
status=$?
echo "Process exited with status ${status}"
lint:
name: "Lint - Stable"
runs-on: ubuntu-latest
steps:
- name: Checkout tiledb-rs
uses: actions/checkout@v4
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Setup Rustc Cache
uses: Swatinem/rust-cache@v2
- name: Install TileDB
uses: ./.github/actions/install-tiledb
- name: Check Formatting
run: cargo fmt --quiet --check
- name: Lint
run: cargo clippy --no-deps --all-targets --all-features -- -Dwarnings
lint-nightly:
name: "Lint - Nightly"
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: Checkout tiledb-rs
uses: actions/checkout@v4
- name: Install Rust Nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
- name: Setup Rustc Cache
uses: Swatinem/rust-cache@v2
- name: Install TileDB
uses: ./.github/actions/install-tiledb
- name: Check Formatting
run: cargo fmt --quiet --check
- name: Lint
run: cargo clippy --no-deps --all-targets --all-features -- -Dwarnings
check-pr-title:
name: "Check Title Format"
if: ${{ github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- name: "Check Title Format"
shell: python
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
import os
import re
PAT = re.compile(r"^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)")
if not PAT.match(os.environ["PR_TITLE"]):
print("The pull request title does not match Conventional Commits syntax")
print("See: https://www.conventionalcommits.org/en/v1.0.0/")
exit(1)
check-api-coverage:
name: "Check API Coverage"
runs-on: ubuntu-latest
steps:
- name: Checkout tiledb-rs
uses: actions/checkout@v4
- name: Install Rust Stable
uses: dtolnay/rust-toolchain@stable
- name: Setup Rustc Cache
uses: Swatinem/rust-cache@v2
- name: Install Cargo Expand
run: cargo install cargo-expand
- name: Install TileDB
uses: ./.github/actions/install-tiledb
- name: Build API Coverage Tool
run: cd tools/api-coverage && cargo build
- name: Calculate Coverage
run: ./target/debug/api-coverage 2>&1 >> $GITHUB_STEP_SUMMARY