Skip to content

Commit 06c8dac

Browse files
committed
Run the unit tests
Future commits will massage the file in the right format as its not there yet and gets certain parameters which are not implemented yet. We'll need to play around with the unit test upload features (https://github.com/EnricoMi/publish-unit-test-result-action#configuration) what works best.
1 parent d2411c7 commit 06c8dac

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

.github/workflows/unit-tests.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Detect changes to manually verify
1818
run: diff newcodecov .github/jobs/uploadcodecov.sh
1919

20-
integration:
20+
unit-tests:
2121
runs-on: ubuntu-24.04
2222
timeout-minutes: 20
2323
container:
@@ -32,6 +32,10 @@ jobs:
3232
MYSQL_USER: domjudge
3333
MYSQL_PASSWORD: domjudge
3434
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3
35+
strategy:
36+
matrix:
37+
PHPVERSION: [8.1, 8.4]
38+
TEST: [Unit, E2E]
3539
steps:
3640
- uses: actions/checkout@v4
3741
- name: info
@@ -46,9 +50,18 @@ jobs:
4650
- name: pstree
4751
run: pstree -p
4852
- name: Install DOMjudge
49-
run: .github/jobs/baseinstall.sh all
53+
run: .github/jobs/baseinstall.sh unit install test
5054
- name: Check nginx
5155
run: curl -v https://localhost/domjudge/
56+
- name: Run the unit-tests
57+
run: .github/jobs/unit-tests.sh ${{ matrix.PHPVERSION }} ${{ matrix.TEST }}
58+
- name: Publish Test Results
59+
uses: EnricoMi/publish-unit-test-result-action@v2
60+
if: ${{ !cancelled() }}
61+
with:
62+
comment_mode: changes in failures
63+
check_name: unit-tests-${{ matrix.PHPVERSION }}-${{ matrix.TEST }}.xml
64+
files: unit-tests-${{ matrix.PHPVERSION }}-${{ matrix.TEST }}.xml
5265
- name: Get SQL logs
5366
run: docker logs "${{ job.services.sqlserver.id }}"
5467
- name: Collect docker logs on failure
@@ -60,15 +73,9 @@ jobs:
6073
if: ${{ !cancelled() }}
6174
uses: actions/upload-artifact@v4
6275
with:
63-
name: Logs
76+
name: Logs-${{ matrix.PHPVERSION }}-${{ matrix.TEST }}
6477
path: |
6578
/var/log/nginx
6679
/opt/domjudge/domserver/webapp/var/log/*.log
6780
/tmp/docker-logs
6881
/tmp/artifacts
69-
- name: Verify no errors in symfony {prod,test,dev}.log
70-
shell: bash
71-
run: |
72-
if cat /opt/domjudge/domserver/webapp/var/log/*.log | egrep '(CRITICAL|ERROR):'; then
73-
exit 1
74-
fi

0 commit comments

Comments
 (0)