Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 14 additions & 37 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
# These versions match Upsun support
# Node.js: https://docs.upsun.com/languages/nodejs.html#supported-versions
node-version: [18.x, 20.x, 21.x]
node-version: [22.x, 24.x]
# Python: https://docs.upsun.com/languages/python.html#supported-versions
python-version: ['3.9', '3.10', '3.11', '3.12']

Expand All @@ -41,57 +41,34 @@ jobs:

################################################################################################
# B. Prettify, lint, and test repo.
- name: "4. Preparing"
- name: "4. Set up Bun"
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: "5. Preparing"
run: |
echo "::notice::Running react-scripts tests."
export CI=true
npm install cross-env npm-run-all -g
npm install
- name: "5. Verifying backend code is pretty"
run: |
cd frontend && bun install
- name: "6. Verifying backend code is pretty"
run: |
npm run prettier:backend
- name: "6. Verifying frontend code is pretty"
- name: "7. Verifying frontend code is pretty"
run: |
npm run prettier:frontend
- name: "7. Linting frontend"
- name: "8. Linting frontend"
run: npm run lint:frontend
- name: "8. Run Frontend tests"
- name: "9. Run Frontend tests"
run: npm run test:frontend
- name: "9. Run Backend linting"
- name: "10. Run Backend linting"
run: |
npm run lint:backend

################################################################################################
# C. Ensure no vulnerabilities.
- name: "10. Test: there should be no Python vulnerabilities."
- name: "11. Test: there should be no Python vulnerabilities."
run: |
echo "::notice::Checking for vulnerabilities in backend Python app dependencies."
npm run test:backend
- name: "11. Test: there should be no HIGH Node.js vulnerabilities."
run: |
echo "::notice::Checking for high vulnerabilities in frontend Node.js app dependencies."
cd frontend
export CI=true
HIGH_VULN_ALLOWED=${{ env.MAX_HIGH }}
HIGH_VULN=$(npm audit --json | jq '.metadata.vulnerabilities.high')
if [ "$HIGH_VULN" -gt "$HIGH_VULN_ALLOWED" ]; then
echo "::error::NPM HIGH vulnerabilities exceed allowed budget."
npm audit
exit 1
else
echo "::notice::No HIGH vulnerabilities found on frontend app."
fi
- name: "12. Test: there should be no CRITICAL Node.js vulnerabilities."
run: |
echo "::notice::Checking for critical vulnerabilities in frontend Node.js app dependencies."
cd frontend
export CI=true
CRITICAL_VULN_ALLOWED=${{ env.MAX_CRITICAL }}
CRITICAL_VULN=$(npm audit --json | jq '.metadata.vulnerabilities.high')
if [ "$CRITICAL_VULN" -gt "$CRITICAL_VULN_ALLOWED" ]; then
echo "::error::NPM CRITICAL vulnerabilities exceed allowed budget."
npm audit
exit 1
else
echo "::notice::No CRITICAL vulnerabilities found on frontend app."
fi
6 changes: 2 additions & 4 deletions .upsun/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ applications:
variables:
env:
REACT_APP_BACKEND_URL: "/"
npm_config_loglevel: silent
NPM_CONFIG_UPDATE_NOTIFIER: false

hooks:
build: |
set -eux
npm install
bun install
export REACT_APP_PROJECT_ID=$PLATFORM_PROJECT
npm run build
bun run build

relationships:
api: "backend:http"
Expand Down
Loading
Loading