Database Upgrade Test #1952
Workflow file for this run
This file contains hidden or 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: Database Upgrade Test | |
| on: | |
| merge_group: | |
| pull_request: | |
| branches: | |
| - main | |
| - '[0-9]+.[0-9]+' | |
| jobs: | |
| upgrade_test: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: domjudge/gitlabci:24.04 | |
| services: | |
| sqlserver: | |
| image: mariadb | |
| ports: | |
| - 3306:3306 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_USER: domjudge | |
| MYSQL_PASSWORD: domjudge | |
| options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache node modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: webapp/node_modules | |
| key: npm-${{ hashFiles('webapp/package-lock.json') }} | |
| restore-keys: | | |
| npm- | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: webapp/vendor | |
| key: composer-${{ hashFiles('webapp/composer.lock') }} | |
| restore-keys: | | |
| composer- | |
| - name: Import Database | |
| run: mysql -hsqlserver -uroot -proot < .github/jobs/data/dj733.sql | |
| - name: Upgrade DOMjudge | |
| run: .github/jobs/baseinstall.sh default upgrade | |
| - name: Setting initial Admin Password | |
| run: echo "pass" > /opt/domjudge/domserver/etc/initial_admin_password.secret | |
| - name: Check for Errors in the Upgrade | |
| run: mysql -hsqlserver -uroot -proot -e "SHOW TABLES FROM domjudge;" | |
| - name: Check for Errors in DOMjudge Webinterface | |
| run: .github/jobs/webstandard.sh none admin | |
| - name: dump the db | |
| if: ${{ !cancelled() }} | |
| run: mysqldump -uroot -proot --quick --max_allowed_packet=1024M domjudge > /tmp/db.sql | |
| - name: Upload database dump for debugging | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: DB-dump | |
| path: /tmp/db.sql | |
| - name: Get SQL logs | |
| run: docker logs "${{ job.services.sqlserver.id }}" | |
| - name: Collect docker logs on failure | |
| if: ${{ !cancelled() }} | |
| uses: jwalton/gh-docker-logs@v1 | |
| with: | |
| dest: '/tmp/docker-logs' | |
| - name: Upload all logs/artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Logs | |
| path: | | |
| /var/log/nginx | |
| /opt/domjudge/domserver/webapp/var/log/*.log | |
| /tmp/docker-logs | |
| /tmp/artifacts |