-
-
Notifications
You must be signed in to change notification settings - Fork 216
119 lines (98 loc) · 2.93 KB
/
legacy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Legacy
on:
workflow_dispatch:
push:
branches: [main, stable-*]
paths:
- .github/workflows/legacy.yml
- api/**
- legacy/**
pull_request:
branches: [main, stable-*]
paths:
- .github/workflows/legacy.yml
- api/**
- legacy/**
schedule:
- cron: 0 1 * * 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php-version: "7.4" # Focal, Bullseye
steps:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Lint
run: make lint
working-directory: legacy
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php-version: "7.4" # Focal, Bullseye
env:
ENVIRONMENT: testing
steps:
- uses: actions/checkout@v4
- 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;'
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: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
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
locale:
runs-on: ubuntu-latest
if: >
github.repository_owner == 'libretime' && (
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
)
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.LIBRETIME_BOT_TOKEN }}
- 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"
git pull
make -C legacy/locale update
git add legacy/locale
git diff-index --quiet HEAD -- legacy/locale || {
git commit --message "chore(legacy): update locales"
git push
}