-
-
Notifications
You must be signed in to change notification settings - Fork 65
78 lines (73 loc) · 2.04 KB
/
Copy pathrsky-pdsadmin.yml
File metadata and controls
78 lines (73 loc) · 2.04 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
name: rsky-pdsadmin CI
on:
push:
branches: [main]
pull_request:
paths:
- '.github/workflows/rsky-pdsadmin.yml'
- 'rsky-pdsadmin/**'
- 'rust-toolchain'
jobs:
# Run formatting check
formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Run cargo fmt
working-directory: ./rsky-pdsadmin
run: cargo fmt -- --check
# Check job for rsky-pdsadmin
check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: rsky-pdsadmin
- name: Run cargo check
working-directory: ./rsky-pdsadmin
run: cargo check
# Build and test job for rsky-pdsadmin
build-and-test:
needs: check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install nightly toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: rsky-pdsadmin
- name: Run cargo build
working-directory: ./rsky-pdsadmin
run: cargo build --release
- name: Run cargo test
working-directory: ./rsky-pdsadmin
run: cargo test
# Final job that depends on all tests to signal success
ci-success:
runs-on: ubuntu-latest
needs: [check, build-and-test, formatting]
if: always()
steps:
- name: CI Success
if: ${{ !contains(needs.*.result, 'failure') }}
run: echo "All CI jobs passed!"
- name: CI Failed
if: ${{ contains(needs.*.result, 'failure') }}
run: |
echo "Some CI jobs failed!"
exit 1