Files
holiday-property-booking/.gitea/workflows/test-build.yml
Chris Dumas e468876d59
Some checks failed
Deploy Holiday Property Booking / deploy (push) Successful in 1m43s
Playwright Holiday Property Booking / playwright (push) Failing after 1m42s
Test & Build Holiday Property Booking / test-build (push) Successful in 1m20s
ci: skip node setup when already present
2026-05-26 08:13:05 +00:00

55 lines
1.2 KiB
YAML

name: Test & Build Holiday Property Booking
on:
pull_request:
push:
branches:
- develop
- qa
- master
- main
jobs:
test-build:
runs-on: docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
github-server-url: https://git.dumas.ddns.net
- name: Check existing Node.js
id: node-check
shell: bash
run: |
set -Eeuo pipefail
if command -v node >/dev/null 2>&1; then
node_version="$(node -p 'process.versions.node')"
node_major="${node_version%%.*}"
if [ "$node_major" = "20" ]; then
echo "use_existing_node=true" >> "$GITHUB_OUTPUT"
echo "Node.js $node_version already available; skipping setup-node"
exit 0
fi
fi
echo "use_existing_node=false" >> "$GITHUB_OUTPUT"
- name: Setup Node.js
if: steps.node-check.outputs.use_existing_node != 'true'
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Build
run: npm run build