-
Notifications
You must be signed in to change notification settings - Fork 13
82 lines (77 loc) · 2.24 KB
/
ci.yml
File metadata and controls
82 lines (77 loc) · 2.24 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_call:
inputs:
ref:
type: string
required: false
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.ref || '' }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo update -p native-tls
- run: cargo fmt --all -- --check
- run: cargo clippy --all-features -- -D warnings
- name: Run Tempo Lints
uses: tempoxyz/lints@main
with:
language: rust
path: "."
post-comment: false
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install ast-grep
uses: jaxxstorm/action-install-gh-release@v1
with:
repo: ast-grep/ast-grep
tag: "0.37.0"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run ast-grep lint
run: sg scan -c sgconfig.yml src/
- name: Run ast-grep tests
run: sg test -c sgconfig.yml
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ inputs.ref || '' }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo update -p native-tls
- uses: taiki-e/install-action@cargo-hack
- name: Tests
run: cargo test --features tempo,stripe,server,client,axum,middleware,tower,utils,integration-stripe
env:
STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }}
- run: cargo hack check --each-feature --no-dev-deps --skip integration
- name: Check examples
run: find examples -name Cargo.toml -exec cargo check --manifest-path {} \;
ci-gate:
name: CI Gate
if: always()
needs: [lint, test]
runs-on: ubuntu-latest
steps:
- run: |
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more required jobs failed or were cancelled"
exit 1
fi