2022-04-25 15:27:10 +02:00
|
|
|
name: Legacy
|
|
|
|
|
|
|
|
on:
|
2023-02-27 12:34:17 +01:00
|
|
|
workflow_dispatch:
|
2022-04-25 15:27:10 +02:00
|
|
|
push:
|
2024-01-13 12:50:51 +01:00
|
|
|
branches: [main, stable-*]
|
2022-04-25 15:27:10 +02:00
|
|
|
paths:
|
2022-09-14 13:45:26 +02:00
|
|
|
- .github/workflows/legacy.yml
|
2022-04-25 15:27:10 +02:00
|
|
|
- api/**
|
|
|
|
- legacy/**
|
|
|
|
|
|
|
|
pull_request:
|
2024-01-13 12:50:51 +01:00
|
|
|
branches: [main, stable-*]
|
2022-04-25 15:27:10 +02:00
|
|
|
paths:
|
2022-09-14 13:45:26 +02:00
|
|
|
- .github/workflows/legacy.yml
|
2022-04-25 15:27:10 +02:00
|
|
|
- api/**
|
|
|
|
- legacy/**
|
|
|
|
|
2022-12-07 13:08:13 +01:00
|
|
|
schedule:
|
|
|
|
- cron: 0 1 * * 1
|
|
|
|
|
2022-04-25 15:27:10 +02:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
2022-08-24 12:08:30 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2022-09-09 20:45:59 +02:00
|
|
|
- php-version: "7.4" # Focal, Bullseye
|
2022-08-24 12:08:30 +02:00
|
|
|
|
2022-04-25 15:27:10 +02:00
|
|
|
steps:
|
2023-10-21 21:30:18 +02:00
|
|
|
- uses: actions/checkout@v4
|
2022-04-25 15:27:10 +02:00
|
|
|
- uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
2022-08-24 12:08:30 +02:00
|
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
|
2022-04-25 15:27:10 +02:00
|
|
|
- name: Lint
|
|
|
|
run: make lint
|
|
|
|
working-directory: legacy
|
|
|
|
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
2022-09-09 20:45:59 +02:00
|
|
|
- php-version: "7.4" # Focal, Bullseye
|
2022-04-25 15:27:10 +02:00
|
|
|
|
|
|
|
env:
|
|
|
|
ENVIRONMENT: testing
|
|
|
|
steps:
|
2023-10-21 21:30:18 +02:00
|
|
|
- uses: actions/checkout@v4
|
2022-04-25 15:27:10 +02:00
|
|
|
|
|
|
|
- name: Setup PostgreSQL
|
|
|
|
run: |
|
|
|
|
sudo systemctl start postgresql.service
|
|
|
|
pg_isready
|
|
|
|
sudo -u postgres psql -c 'CREATE DATABASE libretime;'
|
|
|
|
sudo -u postgres psql -c "CREATE USER libretime WITH PASSWORD 'libretime';"
|
|
|
|
sudo -u postgres psql -c 'GRANT CONNECT ON DATABASE libretime TO libretime;'
|
2025-01-08 17:53:45 +01:00
|
|
|
sudo -u postgres psql -c 'ALTER DATABASE libretime OWNER TO libretime;'
|
2022-04-25 15:27:10 +02:00
|
|
|
sudo -u postgres psql -c 'ALTER USER libretime CREATEDB;'
|
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
|
|
|
|
- name: Get Composer Cache Directory
|
|
|
|
id: composer-cache
|
|
|
|
run: |
|
2023-02-27 13:54:14 +01:00
|
|
|
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
2022-04-25 15:27:10 +02:00
|
|
|
|
2024-01-19 18:05:01 +01:00
|
|
|
- uses: actions/cache@v4
|
2022-04-25 15:27:10 +02:00
|
|
|
with:
|
|
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-composer-
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: make test
|
|
|
|
working-directory: legacy
|
2023-02-26 18:07:04 +01:00
|
|
|
|
|
|
|
locale:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2023-02-27 12:36:56 +01:00
|
|
|
if: >
|
|
|
|
github.repository_owner == 'libretime' && (
|
|
|
|
github.event_name == 'schedule' ||
|
|
|
|
github.event_name == 'workflow_dispatch'
|
|
|
|
)
|
2023-02-26 18:07:04 +01:00
|
|
|
steps:
|
2023-10-21 21:30:18 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-02-27 12:36:56 +01:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.LIBRETIME_BOT_TOKEN }}
|
2023-02-26 18:07:04 +01:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
DEBIAN_FRONTEND=noninteractive sudo apt-get update
|
|
|
|
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y gettext
|
|
|
|
|
|
|
|
- name: Update locales
|
|
|
|
run: |
|
|
|
|
git config --global user.name "libretime-bot"
|
|
|
|
git config --global user.email "libretime-bot@users.noreply.github.com"
|
|
|
|
|
2023-02-27 12:36:56 +01:00
|
|
|
git pull
|
|
|
|
|
|
|
|
make -C legacy/locale update
|
|
|
|
|
2023-02-26 18:07:04 +01:00
|
|
|
git add legacy/locale
|
|
|
|
git diff-index --quiet HEAD -- legacy/locale || {
|
|
|
|
git commit --message "chore(legacy): update locales"
|
|
|
|
git push
|
|
|
|
}
|