1.0.0 #16
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
name: Build and test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install dependencies | |
run: npm ci | |
- name: Build project | |
run: npm run build | |
- name: Check diff | |
# Take from https://github.com/ionic-team/ionic-framework/blob/c801e2ada9d1f36bbb8ed58d814afae94510e304/.github/workflows/actions/test-core-clean-build/action.yml | |
run: | | |
git diff --exit-code || { | |
echo -e "\033[1;31m⚠️ Error: Differences Detected ⚠️\033[0m" | |
echo -e "\033[1;31mThere are uncommitted changes between the build outputs from CI and your branch.\033[0m" | |
echo -e "\033[1;31mPlease ensure you have followed these steps:\033[0m" | |
echo -e "\033[1;31m1. Run 'npm run build' locally to generate the latest build output.\033[0m" | |
echo -e "\033[1;31m2. Commit and push all necessary changes to your branch.\033[0m" | |
echo -e "\033[1;31m3. Compare and validate the differences before proceeding.\033[0m" | |
exit 1 | |
} |