Skip to content

Commit 458f7d4

Browse files
committed
Implement optionally running this
1 parent 2f83785 commit 458f7d4

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

.github/workflows/unit-tests.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,18 @@ jobs:
3939
TEST: [Unit, E2E]
4040
steps:
4141
- name: Skip this job when not in a merge queue for some combinations
42+
id: skip_check
4243
run: |
4344
if [ "${{ !contains(github.ref, 'gh-readonly-queue') }}" ]; then
4445
if [ "${{ matrix.PHPVERSION }}" -ne "8.4" ]; then
45-
exit 0
46+
echo "::set-output name=skip::true"
4647
fi
4748
fi
48-
- uses: actions/checkout@v4
49+
- name: Get the repository
50+
if: steps.skip_check.outputs.run == 'true'
51+
uses: actions/checkout@v4
4952
- name: info
53+
if: steps.skip_check.outputs.run == 'true'
5054
run: |
5155
cat /proc/cmdline && echo &&
5256
cat /proc/mounts && echo &&
@@ -56,27 +60,32 @@ jobs:
5660
cat /proc/self/cgroup && echo &&
5761
cat /proc/cpuinfo
5862
- name: pstree
63+
if: steps.skip_check.outputs.run == 'true'
5964
run: pstree -p
6065
- name: Install DOMjudge
66+
if: steps.skip_check.outputs.run == 'true'
6167
run: .github/jobs/baseinstall.sh unit install ${{ matrix.PHPVERSION }} test
6268
- name: Check nginx
69+
if: steps.skip_check.outputs.run == 'true'
6370
run: curl -v https://localhost/domjudge/
6471
- name: Run the unit-tests
72+
if: steps.skip_check.outputs.run == 'true'
6573
run: .github/jobs/unit-tests.sh ${{ matrix.PHPVERSION }} ${{ matrix.TEST }}
6674
- name: Publish Test Results
6775
uses: EnricoMi/publish-unit-test-result-action@v2
68-
if: ${{ !cancelled() }}
76+
if: "${{ steps.skip_check.outputs.run == 'true'}} && ${{ !cancelled() }}"
6977
with:
7078
files: /tmp/artifacts/unit-tests.xml
7179
- name: Get SQL logs
80+
if: steps.skip_check.outputs.run == 'true'
7281
run: docker logs "${{ job.services.sqlserver.id }}"
7382
- name: Collect docker logs on failure
74-
if: ${{ !cancelled() }}
83+
if: "${{ steps.skip_check.outputs.run == 'true'}} && ${{ !cancelled() }}"
7584
uses: jwalton/gh-docker-logs@v1
7685
with:
7786
dest: '/tmp/docker-logs'
7887
- name: Upload all logs/artifacts
79-
if: ${{ !cancelled() }}
88+
if: "${{ steps.skip_check.outputs.run == 'true'}} && ${{ !cancelled() }}"
8089
uses: actions/upload-artifact@v4
8190
with:
8291
name: Logs
@@ -86,6 +95,7 @@ jobs:
8695
/tmp/docker-logs
8796
/tmp/artifacts
8897
- name: Verify no errors in prod.log
98+
if: steps.skip_check.outputs.run == 'true'
8999
shell: bash
90100
run: |
91101
if cat /opt/domjudge/domserver/webapp/var/log/*.log | egrep '(CRITICAL|ERROR):'; then

0 commit comments

Comments
 (0)