Skip to content

Commit 68e7de5

Browse files
committed
Build and test strict Snap package with bundled compiler and GUI smoke checks
1 parent 5797b77 commit 68e7de5

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

‎.github/workflows/snap.yml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: snap-strict
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches: [fix/snap-strict-release]
6+
permissions:
7+
contents: read
8+
jobs:
9+
snap:
10+
runs-on: ubuntu-24.04
11+
timeout-minutes: 60
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Build strict snap
15+
uses: snapcore/action-build@v1
16+
id: build
17+
- name: Verify confinement and install test package
18+
env:
19+
SNAP_FILE: ${{ steps.build.outputs.snap }}
20+
run: |
21+
unsquashfs -cat "$SNAP_FILE" meta/snap.yaml > snap-metadata.yaml
22+
grep -qx 'confinement: strict' snap-metadata.yaml
23+
sudo snap install --dangerous "$SNAP_FILE"
24+
- name: Test bundled compiler and actual GUI under confinement
25+
run: |
26+
mkdir -p "$HOME/snap/medha-ide/common"
27+
timeout 180 snap run medha-ide --selftest
28+
export QT_QPA_PLATFORM=offscreen
29+
export MEDHA_SMOKE_RESULT="$HOME/snap/medha-ide/common/gui-smoke.json"
30+
timeout 180 snap run medha-ide --smoke-gui
31+
python3 -c 'import json,os; assert json.load(open(os.environ["MEDHA_SMOKE_RESULT"]))["status"] == "PASS"'
32+
- name: Collect test evidence
33+
if: always()
34+
run: |
35+
mkdir -p snap-evidence
36+
cp snap-metadata.yaml snap-evidence/ 2>/dev/null || true
37+
cp "$HOME"/snap/medha-ide/common/gui-smoke.* snap-evidence/ 2>/dev/null || true
38+
- uses: actions/upload-artifact@v4
39+
if: always()
40+
with:
41+
name: medha-strict-snap
42+
path: |
43+
${{ steps.build.outputs.snap }}
44+
snap-evidence/
45+
if-no-files-found: error

0 commit comments

Comments
 (0)