Skip to content

Commit

Permalink
Implement optionally running this
Browse files Browse the repository at this point in the history
  • Loading branch information
vmcj committed Dec 7, 2024
1 parent 2f83785 commit 458f7d4
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ jobs:
TEST: [Unit, E2E]
steps:
- name: Skip this job when not in a merge queue for some combinations
id: skip_check
run: |
if [ "${{ !contains(github.ref, 'gh-readonly-queue') }}" ]; then
if [ "${{ matrix.PHPVERSION }}" -ne "8.4" ]; then
exit 0
echo "::set-output name=skip::true"
fi
fi
- uses: actions/checkout@v4
- name: Get the repository
if: steps.skip_check.outputs.run == 'true'
uses: actions/checkout@v4
- name: info
if: steps.skip_check.outputs.run == 'true'
run: |
cat /proc/cmdline && echo &&
cat /proc/mounts && echo &&
Expand All @@ -56,27 +60,32 @@ jobs:
cat /proc/self/cgroup && echo &&
cat /proc/cpuinfo
- name: pstree
if: steps.skip_check.outputs.run == 'true'
run: pstree -p
- name: Install DOMjudge
if: steps.skip_check.outputs.run == 'true'
run: .github/jobs/baseinstall.sh unit install ${{ matrix.PHPVERSION }} test
- name: Check nginx
if: steps.skip_check.outputs.run == 'true'
run: curl -v https://localhost/domjudge/
- name: Run the unit-tests
if: steps.skip_check.outputs.run == 'true'
run: .github/jobs/unit-tests.sh ${{ matrix.PHPVERSION }} ${{ matrix.TEST }}
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{ !cancelled() }}
if: "${{ steps.skip_check.outputs.run == 'true'}} && ${{ !cancelled() }}"
with:
files: /tmp/artifacts/unit-tests.xml
- name: Get SQL logs
if: steps.skip_check.outputs.run == 'true'
run: docker logs "${{ job.services.sqlserver.id }}"
- name: Collect docker logs on failure
if: ${{ !cancelled() }}
if: "${{ steps.skip_check.outputs.run == 'true'}} && ${{ !cancelled() }}"
uses: jwalton/gh-docker-logs@v1
with:
dest: '/tmp/docker-logs'
- name: Upload all logs/artifacts
if: ${{ !cancelled() }}
if: "${{ steps.skip_check.outputs.run == 'true'}} && ${{ !cancelled() }}"
uses: actions/upload-artifact@v4
with:
name: Logs
Expand All @@ -86,6 +95,7 @@ jobs:
/tmp/docker-logs
/tmp/artifacts
- name: Verify no errors in prod.log
if: steps.skip_check.outputs.run == 'true'
shell: bash
run: |
if cat /opt/domjudge/domserver/webapp/var/log/*.log | egrep '(CRITICAL|ERROR):'; then
Expand Down

0 comments on commit 458f7d4

Please sign in to comment.