Merge rounds that share the same live stream #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 poppler-utils" | |
run: sudo apt-get update && sudo apt-get install poppler-utils -y | |
- name: "Build Calendar" | |
run: | | |
composer install --no-dev | |
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 |