70 lines
1.9 KiB
YAML
70 lines
1.9 KiB
YAML
# CluPilot CI — runs on Gitea Actions (GitHub-Actions syntax, own runner).
|
|
#
|
|
# Deliberately not mirrored to GitHub: this repository describes how our
|
|
# infrastructure is provisioned, and the same workflow runs at home. If we ever
|
|
# move, this file goes along unchanged.
|
|
name: tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main, 'feat/**']
|
|
pull_request:
|
|
|
|
jobs:
|
|
pest:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: '8.4'
|
|
extensions: mbstring, pdo_sqlite, sodium, redis, bcmath, gd, zip
|
|
coverage: none
|
|
|
|
- name: Install PHP dependencies
|
|
run: composer install --no-interaction --prefer-dist --no-progress
|
|
|
|
- name: Prepare environment
|
|
run: |
|
|
cp .env.example .env
|
|
php artisan key:generate
|
|
|
|
- name: Tests
|
|
# phpunit.xml pins its own sqlite/array drivers, so no services needed.
|
|
run: ./vendor/bin/pest --colors=always
|
|
|
|
assets:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install JS dependencies
|
|
run: npm ci --no-fund --no-audit
|
|
|
|
# A build failure here is what used to surface as "the design is broken"
|
|
# only after deploying — catch it before it ships.
|
|
- name: Build assets
|
|
run: npm run build
|
|
|
|
release:
|
|
# Only a green run produces the tag the console offers as an update.
|
|
needs: [pest, assets]
|
|
if: github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Tag this commit as tested
|
|
run: |
|
|
tag="tested-$(date -u +%Y%m%d-%H%M)-$(git rev-parse --short HEAD)"
|
|
git tag "$tag"
|
|
git push origin "$tag"
|