Skip to content

Commit

Permalink
chore: add amplify backend validation in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronZyLee committed Aug 15, 2024
1 parent 826ffe8 commit 329efb9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions codebuild_specs/pr_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,7 @@ batch:
buildspec: codebuild_specs/mock_e2e_tests.yml
depend-on:
- build_linux
- identifier: verify_amplify_backend_compatability
buildspec: codebuild_specs/verify_amplify_backend_compatability.yml
depend-on:
- build_linux
7 changes: 7 additions & 0 deletions codebuild_specs/verify_amplify_backend_compatability.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 0.2
env:
shell: bash
phases:
build:
commands:
- source ./shared-scripts.sh && _verifyAPIExtract
20 changes: 20 additions & 0 deletions shared-scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,26 @@ function _lint {
loadCacheFromBuildJob
chmod +x codebuild_specs/scripts/lint_pr.sh && ./codebuild_specs/scripts/lint_pr.sh
}
function _verifyAmplifyBackendCompatability {
echo "Verify Amplify Backend Compatability"
loadCacheFromBuildJob
yarn verdaccio-clean
source ./shared-scripts.sh && _publishLocalWorkspace
setNpmRegistryUrlToLocal
npm config get registry

cd ..
git clone https://github.com/aws-amplify/amplify-backend.git
cd amplify-backend
npm update
git diff package-lock.json | grep -e 'graphql-api-construct' -e 'data-construct'
npm run build && npm run test

cd $CODEBUILD_SRC_DIR
unsetNpmRegistryUrl
npm config get registry
yarn verdaccio-stop
}
function _publishToLocalRegistry {
echo "Publish To Local Registry"
loadCacheFromBuildJob
Expand Down

0 comments on commit 329efb9

Please sign in to comment.