-
-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (54 loc) · 1.72 KB
/
pull_requests.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
name: "Pull Request"
on:
pull_request:
branches: [ "main" ]
permissions:
pull-requests: write
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@master
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer
- name: "Run phpunit"
run: make test
- name: "PHPStan"
uses: php-actions/phpstan@v3
with:
level: 6
calendar-diff:
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@master
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer
- name: "Install dependencies"
run: |
sudo apt-get update && sudo apt-get install poppler-utils -y
composer install --no-dev
- name: "Generate Calendar"
run: php app/run.php --season 2024 --output new-calendar.json --format json
- name: "Check diff"
run: |
curl -sSL "https://calendar.ifsc.stream/?format=json&nocache=1" --output old-calendar.json
php bin/calendar-diff old-calendar.json new-calendar.json > diff.md
if [ $(wc -w < diff.md) -gt 0 ]; then
echo "This PR produces the following changes in the calendar" > calendar.diff
cat diff.md >> calendar.diff
else
echo "No changes in the calendar were produced" > calendar.diff
fi
- name: "Comment calendar diff in PR"
uses: thollander/actions-comment-pull-request@v2
with:
filePath: calendar.diff
comment_tag: calendar_diff