mirror of
https://github.com/klaussilveira/gitlist.git
synced 2026-01-16 12:32:40 +01:00
117 lines
3.0 KiB
YAML
117 lines
3.0 KiB
YAML
name: Build
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
backend:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
php: [8.1, 8.2, 8.3, 8.4]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Validate composer.json and composer.lock
|
|
run: composer validate --strict --no-check-version
|
|
|
|
- name: Cache Composer packages
|
|
id: composer-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: vendor
|
|
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-php-
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress
|
|
|
|
- name: Run unit test suite
|
|
run: composer run-script unit
|
|
|
|
- name: Validate coding standards
|
|
run: composer run-script cs
|
|
|
|
- name: Run linters
|
|
run: composer run-script lint
|
|
|
|
- name: Run static analysis
|
|
run: composer run-script stan
|
|
|
|
frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js environment
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm install
|
|
|
|
- name: Run frontend test suite
|
|
run: npm test
|
|
|
|
acceptance:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Cache Composer packages
|
|
id: composer-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: vendor
|
|
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-php-
|
|
|
|
- name: Setup Node.js environment
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install dependencies
|
|
run: composer install --prefer-dist --no-progress && npm install
|
|
|
|
- name: Build frontend assets
|
|
run: npm run build
|
|
|
|
- name: Run application server
|
|
run: echo 'deb [trusted=yes] https://repo.symfony.com/apt/ /' | sudo tee /etc/apt/sources.list.d/symfony-cli.list && sudo apt update && sudo apt install symfony-cli && APP_ENV=prod DEFAULT_REPOSITORY_DIR=${{ github.workspace }}/tests/fixtures symfony server:start --port=8880 -d
|
|
|
|
- name: Run Cypress acceptance tests
|
|
uses: cypress-io/github-action@v6
|
|
|
|
release:
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
runs-on: ubuntu-latest
|
|
needs: [backend, frontend]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js environment
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm install
|
|
|
|
- name: Build package
|
|
run: make build
|
|
|
|
- name: Rename package to current tag
|
|
run: mv build.zip gitlist-${{ github.ref_name }}.zip
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
generate_release_notes: true
|
|
files: gitlist-${{ github.ref_name }}.zip
|