Skip to content

Merge pull request #77 from geneontology/fix-gha-workflows #117

Merge pull request #77 from geneontology/fix-gha-workflows

Merge pull request #77 from geneontology/fix-gha-workflows #117

name: Build and test
on:
pull_request:
push:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Check formatting
run: npx prettier --check .
- name: Lint code
run: npm run lint
- name: Build project
run: npm run build
- name: Check diff
# Taken 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
}
- name: Run tests
run: npm run test