-
-
Notifications
You must be signed in to change notification settings - Fork 55
150 lines (140 loc) · 5.17 KB
/
rust.yml
File metadata and controls
150 lines (140 loc) · 5.17 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: Rust CI
on:
push:
branches: [main]
pull_request:
paths:
- '.github/scripts/determine-packages.sh'
- '.github/workflows/rust.yml'
- 'rsky*/**' # Matches any directory starting with "rsky"
- 'Cargo.toml' # Base workspace configuration
- 'Cargo.lock' # Dependency lock file
- 'rust-toolchain'
# Add other important base paths as needed
env:
PDS_EMAIL_FROM_ADDRESS: "noreply@blacksky.app"
PDS_EMAIL_FROM_NAME: "noreply"
PDS_MODERATION_EMAIL_FROM_NAME: "noreply"
PDS_MODERATION_EMAIL_FROM_ADDRESS: "noreply@blacksky.app"
PDS_HOSTNAME: "rsky.com"
PDS_SERVICE_DID: "did:web:localho.st"
PDS_SERVICE_HANDLE_DOMAINS: ".rsky.com"
PDS_ADMIN_PASS: 3ed1c7b568d3328c44430add531a099f
PDS_JWT_KEY_K256_PRIVATE_KEY_HEX: 9d5907143471e8f0e8df0f8b9512a8c5377878ee767f18fcf961055ecfc071cd
# PDS_ADMIN_PASS: ${{ secrets.PDS_ADMIN_PASS }}
# PDS_JWT_KEY_K256_PRIVATE_KEY_HEX: ${{ secrets.PDS_JWT_KEY_K256_PRIVATE_KEY_HEX }}
PDS_MAILGUN_API_KEY: ${{ secrets.PDS_MAILGUN_API_KEY }}
PDS_MAILGUN_DOMAIN: ${{ secrets.PDS_MAILGUN_DOMAIN }}
#PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: ${{ secrets.PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX }}
#PDS_REPO_SIGNING_KEY_K256_PRIVATE_KEY_HEX: ${{ secrets.PDS_REPO_SIGNING_KEY_K256_PRIVATE_KEY_HEX }}
PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX: fb478b39dd2ddf84bef135dd60f90381903eefadbb9df4b18a2b9b174ae72582
PDS_REPO_SIGNING_KEY_K256_PRIVATE_KEY_HEX: 71cfcf4882a6cff494c3d0affadd3858eb3a5838e7b5e15170e696a590a4fa01
jobs:
# First determine which workspace packages need to be processed
determine-packages:
runs-on: ubuntu-latest
outputs:
packages: ${{ steps.set-packages.outputs.packages }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history to properly check changes
- name: Make script executable
run: chmod +x .github/scripts/determine-packages.sh
- name: Set packages
id: set-packages
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
PR_BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: .github/scripts/determine-packages.sh
shell: bash
# Parallel check job for each package
check:
needs: determine-packages
runs-on: ubuntu-latest
if: ${{ needs.determine-packages.outputs.packages != '[]' }}
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.determine-packages.outputs.packages) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ matrix.package }}
- name: Run cargo check for ${{ matrix.package }}
run: cargo check -p ${{ matrix.package }}
# Parallel build job for each package
build:
needs: [determine-packages, check]
runs-on: ubuntu-latest
if: ${{ needs.determine-packages.outputs.packages != '[]' }}
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.determine-packages.outputs.packages) }}
steps:
- name: Show disk usage (before cleanup)
run: df -h
- name: Clean up large directories
run: |
sudo rm -rf /usr/local/share/boost \
/usr/share/dotnet \
/usr/local/lib/android \
/opt/ghc
- name: Show disk usage (after cleanup)
run: df -h
- name: Checkout code
uses: actions/checkout@v4
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ matrix.package }}
- name: Run cargo build for ${{ matrix.package }}
run: cargo build --release -p ${{ matrix.package }}
# Parallel test job for each package
test:
needs: [determine-packages, check, build]
runs-on: ubuntu-latest
if: ${{ needs.determine-packages.outputs.packages != '[]' }}
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.determine-packages.outputs.packages) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ matrix.package }}
- name: Run cargo test for ${{ matrix.package }}
run: cargo test -p ${{ matrix.package }}
# Run formatting check on the entire workspace
formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Run cargo fmt
run: cargo fmt -- --check
# Optional: Add a final job that depends on all tests to signal success
ci-success:
runs-on: ubuntu-latest
needs: [check, build, 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