System upgrade #77
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
on: pull_request | |
name: Review | |
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#defining-environment-variables-for-a-single-workflow | |
# (cf. services.phpfpm.user in ../../docker-compose.yml) | |
env: | |
COMPOSE_USER: root | |
jobs: | |
changelog: | |
runs-on: ubuntu-latest | |
name: Changelog should be updated | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- run: git fetch | |
- name: Check that changelog has been updated. | |
run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md | |
composer-validate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
docker network create frontend | |
- run: | | |
docker compose run --rm phpfpm composer validate | |
composer-normalize: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: | | |
docker network create frontend | |
docker compose run --rm phpfpm composer install | |
- run: | | |
docker compose run --rm phpfpm composer normalize --dry-run | |
coding-standards: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
script: | |
- code-analysis | |
- coding-standards-check/php | |
- coding-standards-check/twig | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnorton5432/setup-task@v1 | |
- run: | | |
docker network create frontend | |
docker compose run --rm phpfpm composer install | |
- run: | | |
docker compose run --rm phpfpm composer ${{ matrix.script }} | |
site-update: | |
name: Check that site can be updated | |
runs-on: ubuntu-latest | |
steps: | |
# Install site from our base ref | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.base_ref }} | |
- name: setup-docker-and-composer | |
run: | | |
docker network create frontend | |
docker compose pull | |
docker compose up --detach | |
# Important: Use --no-interaction to make https://getcomposer.org/doc/06-config.md#discard-changes have effect. | |
docker compose exec --user root phpfpm composer install --no-interaction --ignore-platform-req=php | |
- name: Install site | |
run: | | |
docker compose exec phpfpm bin/console doctrine:migrations:migrate --no-interaction | |
- name: Build assets | |
run: | | |
docker compose run --rm node yarn install | |
docker compose run --rm node yarn build | |
- name: Clean up root stuff | |
run: | | |
sudo chown -Rv $USER:$USER vendor/ node_modules/ || true | |
# Install site with our current ref | |
- uses: actions/checkout@v4 | |
with: | |
# We want to keep site files generated by site install. | |
# https://github.com/actions/checkout?tab=readme-ov-file#usage | |
clean: false | |
- name: setup-docker-and-composer | |
run: | | |
docker compose pull | |
docker compose up --detach | |
# Important: Use --no-interaction to make https://getcomposer.org/doc/06-config.md#discard-changes have effect. | |
docker compose exec phpfpm composer install --no-interaction | |
- name: Update site | |
run: | | |
docker compose exec phpfpm bin/console doctrine:migrations:migrate --no-interaction | |
- name: Build assets | |
run: | | |
docker compose run --rm node yarn install | |
docker compose run --rm node yarn build |