@@ -98,7 +98,47 @@ concurrency:
98
98
cancel-in-progress : true
99
99
100
100
jobs :
101
+ meta :
102
+ runs-on : ubuntu-latest
103
+ outputs :
104
+ wasmcloud_modified : ${{ steps.changes.outputs.wasmcloud }}
105
+ providers_modified : ${{ steps.changes.outputs.providers }}
106
+ steps :
107
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
108
+ - uses : dorny/paths-filter@v3
109
+ id : changes
110
+ with :
111
+ # Consider wasmCloud changed if any Rust file other than
112
+ # capability providers change
113
+ filters : |
114
+ wasmcloud:
115
+ - './.github/workflows/wasmcloud.yml'
116
+ - './.github/actions/build-nix/action.yml'
117
+ - './.github/actions/install-nix/action.yml'
118
+ - './.config/nextest.toml'
119
+ - 'nix/images/default.nix'
120
+ - 'flake.lock'
121
+ - 'flake.nix'
122
+ - 'Cargo.lock'
123
+ - 'Cargo.toml'
124
+ - 'rust-toolchain.toml'
125
+ - 'crates/**/*'
126
+ - 'crates/provider-sdk/*'
127
+ - 'src/**/*'
128
+ - 'tests/**/*'
129
+ - 'wit/**/*'
130
+ - '!crates/provider-*'
131
+ - '!crates/wash-*/'
132
+ - '!crates/**/*.md'
133
+ - '!wit/**/*.md'
134
+ providers:
135
+ - 'Cargo.lock'
136
+ - 'Cargo.toml'
137
+ - 'crates/provider-*'
138
+ - 'crates/provider-sdk/*'
101
139
build-bin :
140
+ needs : [meta]
141
+ if : ${{ needs.meta.outputs.wasmcloud_modified == 'true' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/wash-cli-v')}}
102
142
strategy :
103
143
matrix :
104
144
config :
@@ -172,8 +212,8 @@ jobs:
172
212
if : ${{ !endsWith(matrix.config.target, 'fhs') }}
173
213
174
214
build-windows :
215
+ if : ${{ startswith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'}}
175
216
name : wasmcloud-x86_64-pc-windows-msvc
176
- if : startswith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
177
217
runs-on : windows-latest
178
218
steps :
179
219
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
@@ -262,6 +302,8 @@ jobs:
262
302
- run : .\bin\wasmcloud.exe --version
263
303
264
304
cargo :
305
+ needs : [meta]
306
+ if : ${{ needs.meta.outputs.wasmcloud_modified == 'true' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/tags/wash-cli-v')}}
265
307
strategy :
266
308
matrix :
267
309
check :
@@ -281,6 +323,9 @@ jobs:
281
323
- run : nix build -L .#checks.x86_64-linux.${{ matrix.check }}
282
324
283
325
build-doc :
326
+ needs : [meta]
327
+ # TODO: maybe we just need this for wasmcloud_host changes
328
+ if : ${{ needs.meta.outputs.wasmcloud_modified == 'true' }}
284
329
runs-on : ubuntu-22.04
285
330
steps :
286
331
- uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
@@ -306,7 +351,7 @@ jobs:
306
351
path : doc
307
352
308
353
providers :
309
- if : startswith(github.ref, 'refs/tags/provider-')
354
+ if : ${{ needs.meta.outputs.providers_modified == 'true' || startswith(github.ref, 'refs/tags/provider-') }}
310
355
strategy :
311
356
matrix :
312
357
include :
@@ -344,6 +389,7 @@ jobs:
344
389
subject : SQLDB_POSTGRES_SUBJECT
345
390
346
391
needs :
392
+ - meta
347
393
- build-bin
348
394
- build-windows
349
395
- test-linux
@@ -778,3 +824,34 @@ jobs:
778
824
git config --global user.email "automation@wasmcloud.com"
779
825
git config --global user.name "wasmCloud automation"
780
826
cargo smart-release --update-crates-index --execute --no-changelog-preview --no-changelog ${{ inputs.additional-args }} ${{ inputs.crate }}
827
+
828
+ # This check always runs, and succeeds either if no relevant wasmCloud files were modified or jobs are successful.
829
+ wasmcloud_successful_checks :
830
+ needs :
831
+ - meta
832
+ - build-bin
833
+ - build-lipo
834
+ - test-linux
835
+ - cargo
836
+ - build-doc
837
+ - providers
838
+ - deploy-doc
839
+ - oci
840
+ if : ${{ always() }}
841
+ runs-on : ubuntu-latest
842
+ steps :
843
+ - name : Results
844
+ run : |
845
+ echo 'needs.integration_tests.result: ${{ needs.integration_tests.result }}'
846
+ echo 'needs.build-bin.result: ${{ needs.build-bin.result }}'
847
+ echo 'needs.build-lipo.result: ${{ needs.build-lipo.result }}'
848
+ echo 'needs.test-linux.result: ${{ needs.test-linux.result }}'
849
+ echo 'needs.cargo.result: ${{ needs.cargo.result }}'
850
+ echo 'needs.build-doc.result: ${{ needs.build-doc.result }}'
851
+ echo 'needs.providers.result: ${{ needs.providers.result }}'
852
+ echo 'needs.deploy-doc.result: ${{ needs.deploy-doc.result }}'
853
+ echo 'needs.oci.result: ${{ needs.oci.result }}'
854
+ - name : Verify jobs
855
+ # All jobs must succeed or be skipped.
856
+ if : contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
857
+ run : exit 1
0 commit comments