-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add region metadata check (#8750)
ref: DTCORE-130 Signed-off-by: Marie JONES <[email protected]>
- Loading branch information
Showing
4 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Check package.json metadatas | ||
on: [push] | ||
|
||
jobs: | ||
check-regions: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Check regions metadata | ||
run: ./scripts/regions/check-regions.sh | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
.PHONY: test | ||
test: | ||
shellcheck scripts/release/release.sh | ||
shellcheck scripts/release/release.sh scripts/regions/check-regions.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Scripts: `check-regions` | ||
|
||
> Check app package.json defines regions metadata | ||
## Prerequisites | ||
|
||
* shellcheck | ||
|
||
|
||
## Usage | ||
|
||
```sh | ||
scripts/regions/check-regions | ||
``` | ||
|
||
## Testing | ||
|
||
``` | ||
make test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
get_apps() { | ||
ls 'packages/manager/apps' | ||
} | ||
|
||
get_package_json() { | ||
app_path="$1" | ||
cat packages/manager/apps/"$app_path"/package.json | ||
} | ||
|
||
main() { | ||
apps=$(get_apps) | ||
while read -r app; do | ||
if ! get_package_json "$app" | grep -q "regions"; then | ||
echo "Missing regions metadata in $app" | ||
exit 1 | ||
fi | ||
done<<<"$apps" | ||
} | ||
|
||
main "${@}" |