ci: eliminate duplicate build_runner run in CheckGenerated #514
+5
-4
@@ -511,10 +511,11 @@ func (m *Ci) CheckGenerated(ctx context.Context) (string, error) {
|
||||
WithDirectory("/committed", m.checkSrc(), dagger.ContainerWithDirectoryOpts{Owner: "ci"}).
|
||||
WithDirectory("/generated", fresh, dagger.ContainerWithDirectoryOpts{Owner: "ci"}).
|
||||
WithExec([]string{"/bin/bash", "-c",
|
||||
`if diff -rq --include='*.g.dart' --include='*.mocks.dart' /committed /generated; then ` +
|
||||
`echo "Generated files are up to date."; ` +
|
||||
`else echo "ERROR: Generated files are out of date — run: dart run build_runner build"; exit 1; ` +
|
||||
`fi`}).
|
||||
`stale=$(find /committed -name '*.g.dart' -o -name '*.mocks.dart' | ` +
|
||||
`while IFS= read -r f; do rel="${f#/committed/}"; diff -q "$f" "/generated/$rel" >/dev/null 2>&1 || echo "$rel"; done); ` +
|
||||
`if [ -n "$stale" ]; then ` +
|
||||
`echo "ERROR: Generated files are out of date — run: dart run build_runner build"; echo "$stale"; exit 1; ` +
|
||||
`else echo "Generated files are up to date."; fi`}).
|
||||
Stdout(ctx)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user