Skip to content

Last gitlab ci

Last gitlab ci #3820

Workflow file for this run

name: Unit tests
# We can speedup with: https://github.com/actions/cache
on:
push:
merge_group:
pull_request:
branches:
- main
- '[0-9]+.[0-9]+'
jobs:
check-static-codecov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download latest codecov upload script
run: wget https://codecov.io/bash -O newcodecov
- name: Detect changes to manually verify
run: diff newcodecov .github/jobs/uploadcodecov.sh
unit-tests:
runs-on: ubuntu-24.04
timeout-minutes: 20
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
strategy:
matrix:
PHPVERSION: [8.1, 8.2, 8.3, 8.4]
TEST: [Unit, E2E]
steps:
- name: Get the repository
uses: actions/checkout@v4
- name: info
run: |
cat /proc/cmdline && echo &&
cat /proc/mounts && echo &&
ls -al /sys/fs/cgroup && echo &&
uname -a && echo &&
stat -fc %T /sys/fs/cgroup && echo &&
cat /proc/self/cgroup && echo &&
cat /proc/cpuinfo
- name: pstree
run: pstree -p
- name: Install DOMjudge
run: .github/jobs/baseinstall.sh unit install ${{ matrix.PHPVERSION }} test
- name: Check nginx
run: curl -v https://localhost/domjudge/
- name: Run the unit-tests
run: .github/jobs/unit-tests.sh ${{ matrix.PHPVERSION }} ${{ matrix.TEST }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ !cancelled() }}
with:
files: /tmp/artifacts/unit-tests.xml
- name: Get SQL logs
run: docker logs "${{ job.services.sqlserver.id }}"
- name: Collect docker logs on failure
if: {{ !cancelled() }}

Check failure on line 68 in .github/workflows/unit-tests.yml

View workflow run for this annotation

GitHub Actions / Unit tests

Invalid workflow file

The workflow is not valid. .github/workflows/unit-tests.yml (Line: 68, Col: 13): A mapping was not expected .github/workflows/unit-tests.yml: Unexpected tag '!cancelled()'
uses: jwalton/gh-docker-logs@v1
with:
dest: '/tmp/docker-logs'
- name: Upload all logs/artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: Logs
path: |
/var/log/nginx
/opt/domjudge/domserver/webapp/var/log/*.log
/tmp/docker-logs
/tmp/artifacts
- name: Verify no errors in prod.log
shell: bash
run: |
if cat /opt/domjudge/domserver/webapp/var/log/*.log | egrep '(CRITICAL|ERROR):'; then
exit 1
fi