deps: be verbose when installing snaps #750
This file contains 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: Test | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number && format('pr{0}', github.event.number) || github.ref_name }} | |
cancel-in-progress: true | |
on: | |
merge_group: | |
types: [checks_requested] | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
paths: | |
- .github/workflows/test*yml | |
- mir-ci/** | |
jobs: | |
RunTests: | |
strategy: | |
fail-fast: false | |
matrix: | |
server: | |
- mir_kiosk | |
- ubuntu_frame | |
- mir_test_tools | |
channel: [stable] | |
include: | |
- server: ubuntu_frame | |
channel: 24/edge | |
- server: mir_test_tools | |
channel: 24/edge | |
- server: mir_demo_server | |
channel: null | |
- server: mir_demo_server | |
channel: null | |
ppa: mir-team/dev | |
- server: confined_shell | |
channel: beta | |
- server: confined_shell | |
channel: edge | |
- server: gnome_shell | |
channel: null | |
- server: null | |
channel: null | |
mark: self | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- id: vars | |
name: Determine variables | |
run: | | |
PYTEST_ARGS=( --verbose --capture=no ) | |
[ -n '${{ matrix.server }}' ] && PYTEST_ARGS+=( -k ${{ matrix.server }} ) | |
[ -n '${{ matrix.mark }}' ] && PYTEST_ARGS+=( -m ${{ matrix.mark }} ) | |
[ '${{ matrix.mark }}' == 'self' ] && PYTEST_ARGS+=( --cov --cov-branch --cov-report=xml ) | |
echo pytest_args=${PYTEST_ARGS[@]} >> $GITHUB_OUTPUT | |
ARTIFACT_KEY="${{ matrix.server || matrix.mark }}" | |
[ -n '${{ matrix.channel }}' ] && ARTIFACT_KEY+="-$( echo ${{ matrix.channel }} | tr / _ )" | |
[ -n '${{ matrix.ppa }}' ] && ARTIFACT_KEY+="-$( echo ${{ matrix.ppa }} | tr / _ )" | |
echo artifact_key=${ARTIFACT_KEY} >> $GITHUB_OUTPUT | |
- name: Set up dependencies | |
working-directory: mir-ci/mir_ci | |
run: | | |
[ -n '${{ matrix.ppa }}' ] && sudo add-apt-repository --yes ppa:${{ matrix.ppa }} | |
SNAP=$( echo ${{ matrix.server }} | tr _ - ) | |
[ -n '${{ matrix.channel }}' ] && sudo snap install ${SNAP} --channel ${{ matrix.channel }} | |
[ -x /snap/${SNAP}/current/bin/setup.sh ] && /snap/${SNAP}/current/bin/setup.sh | |
sudo apt-get --yes install pkg-config libwayland-dev ffmpeg | |
pip install -e .. | |
[ '${{ matrix.mark }}' == 'self' ] && pip install pytest-cov | |
python -m pytest ${{ steps.vars.outputs.pytest_args }} --deps | |
- name: Run the tests | |
working-directory: mir-ci/mir_ci | |
env: | |
MIR_CI_VARIANT: noble/1024/1024x768 | |
run: | | |
# set up coredumps | |
ulimit -c unlimited | |
echo "/tmp/corefile-%e-%p-%t" | sudo tee /proc/sys/kernel/core_pattern | |
sudo systemd-run --uid 1001 -p Environment=XDG_SESSION_TYPE=wayland -p PAMName=login -p TTYPath=/dev/tty1 -- tail -f /dev/null | |
python -m pytest ${{ steps.vars.outputs.pytest_args }} --junitxml=junit-${{ matrix.server || matrix.mark }}-${{ matrix.python }}.xml | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
if: success() || failure() | |
with: | |
name: test-results-${{ steps.vars.outputs.artifact_key }} | |
path: | | |
mir-ci/mir_ci/junit-*.xml | |
/tmp/pytest-of-*/*-current/**/log.html | |
- if: ${{ matrix.mark == 'self' }} | |
name: Upload coverage data | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: mir-ci/mir_ci | |
fail_ci_if_error: true | |
verbose: true | |
- if: ${{ failure() }} | |
name: Collect any core dumps | |
run: | | |
sudo find /tmp/ -name corefile-* -exec chown $UID {} \; -exec mv -v {} . \; | |
- if: ${{ failure() }} | |
name: Upload any core dumps | |
uses: actions/upload-artifact@v4 | |
with: | |
name: core-dumps-${{ steps.vars.outputs.artifact_key }} | |
path: corefile-* | |
if-no-files-found: ignore | |
- if: ${{ failure() && runner.debug }} | |
name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
with: | |
limit-access-to-actor: true | |
ProcessArtifacts: | |
runs-on: ubuntu-24.04 | |
needs: RunTests | |
if: ${{ success() || failure() }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Merge junit reports | |
uses: actions/upload-artifact/merge@v4 | |
with: | |
name: test-results | |
pattern: test-results-* | |
separate-directories: true | |
delete-merged: true | |
- name: Download the test results | |
uses: actions/download-artifact@v4 | |
with: | |
name: test-results | |
- name: Report test results | |
uses: dorny/test-reporter@v1 | |
with: | |
name: "Test results" | |
path: '**/junit-*.xml' | |
reporter: java-junit |