-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (151 loc) · 5.56 KB
/
Copy pathsemver.yml
File metadata and controls
171 lines (151 loc) · 5.56 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: Semver Checks
env:
CARGO_TERM_COLOR: always
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
on:
pull_request:
branches: [main]
jobs:
changes:
name: Changed Crates
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
crates: ${{ steps.filter.outputs.changes }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ruma:
- 'crates/ruma/**'
ruma-appservice-api:
- 'crates/ruma-appservice-api/**'
- 'crates/ruma-macros/**'
ruma-client-api:
- 'crates/ruma-client-api/**'
- 'crates/ruma-macros/**'
ruma-common:
- 'crates/ruma-common/**'
- 'crates/ruma-macros/**'
ruma-events:
- 'crates/ruma-events/**'
- 'crates/ruma-macros/**'
ruma-federation-api:
- 'crates/ruma-federation-api/**'
- 'crates/ruma-macros/**'
ruma-html:
- 'crates/ruma-html/**'
ruma-identity-service-api:
- 'crates/ruma-identity-service-api/**'
- 'crates/ruma-macros/**'
ruma-push-gateway-api:
- 'crates/ruma-push-gateway-api/**'
- 'crates/ruma-macros/**'
ruma-signatures:
- 'crates/ruma-signatures/**'
ruma-state-res:
- 'crates/ruma-state-res/**'
breaking-changes:
name: Breaking Changes
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.crates != '[]' }}
outputs:
ruma: ${{ steps.checks.outputs.ruma }}
ruma-appservice-api: ${{ steps.checks.outputs.ruma-appservice-api }}
ruma-client-api: ${{ steps.checks.outputs.ruma-client-api }}
ruma-common: ${{ steps.checks.outputs.ruma-common }}
ruma-events: ${{ steps.checks.outputs.ruma-events }}
ruma-federation-api: ${{ steps.checks.outputs.ruma-federation-api }}
ruma-html: ${{ steps.checks.outputs.ruma-html }}
ruma-identity-service-api: ${{ steps.checks.outputs.ruma-identity-service-api }}
ruma-push-gateway-api: ${{ steps.checks.outputs.ruma-push-gateway-api }}
ruma-signatures: ${{ steps.checks.outputs.ruma-signatures }}
ruma-state-res: ${{ steps.checks.outputs.ruma-state-res }}
strategy:
matrix:
crate: ${{ fromJSON(needs.changes.outputs.crates) }}
steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install rust stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install cargo-semver-checks
uses: taiki-e/install-action@v2
with:
tool: cargo-semver-checks
- name: Run checks
id: checks
run: |
# Ignore errors
set +e
# This is the syntax for multiline output
echo "${{ matrix.crate }}<<EOF" >> "$GITHUB_OUTPUT"
cargo semver-checks --color never --release-type minor \
-p ${{ matrix.crate }} \
--baseline-rev origin/${{ github.base_ref }} >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"
artifact:
name: Breaking Changes Artifact
runs-on: ubuntu-latest
needs: [changes, breaking-changes]
if: ${{ always() }}
steps:
- name: Build artifact
env:
BREAKING_CHANGES_RESULTS: ${{ toJSON(needs.breaking-changes.outputs) }}
run: |
echo "$BREAKING_CHANGES_RESULTS" >> breaking-changes-results.json
- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: breaking-changes-results
path: breaking-changes-results.json
xtask:
needs: changes
if: ${{ needs.changes.outputs.crates != '[]' }}
uses: ./.github/workflows/xtask.yml
additive-features:
name: Additive Features
runs-on: ubuntu-latest
needs: [changes, xtask]
if: ${{ needs.changes.outputs.crates != '[]' }}
outputs:
ruma: ${{ steps.checks.outputs.ruma }}
ruma-appservice-api: ${{ steps.checks.outputs.ruma-appservice-api }}
ruma-client-api: ${{ steps.checks.outputs.ruma-client-api }}
ruma-common: ${{ steps.checks.outputs.ruma-common }}
ruma-events: ${{ steps.checks.outputs.ruma-events }}
ruma-federation-api: ${{ steps.checks.outputs.ruma-federation-api }}
ruma-html: ${{ steps.checks.outputs.ruma-html }}
ruma-identity-service-api: ${{ steps.checks.outputs.ruma-identity-service-api }}
ruma-push-gateway-api: ${{ steps.checks.outputs.ruma-push-gateway-api }}
ruma-signatures: ${{ steps.checks.outputs.ruma-signatures }}
ruma-state-res: ${{ steps.checks.outputs.ruma-state-res }}
strategy:
matrix:
crate: ${{ fromJSON(needs.changes.outputs.crates) }}
features: [stable, unstable]
steps:
- name: Checkout repo
uses: actions/checkout@v6
- name: Install rust stable toolchain
uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install cargo-semver-checks
uses: taiki-e/install-action@v2
with:
tool: cargo-semver-checks
- name: Get xtask
uses: actions/cache@v5
with:
path: target/debug/xtask
key: xtask-${{ hashFiles('Cargo.toml', 'xtask/src/**', 'xtask/Cargo.toml') }}
- name: Run checks
run: |
target/debug/xtask semver --no-color additive-features ${{ matrix.crate }} ${{ matrix.features }}