Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/snap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Snap

on:
push:
branches:
- main
tags:
- 'v*'
paths:
- '.github/workflows/snap.yml'
- 'snap/**'
pull_request:
paths:
- '.github/workflows/snap.yml'
- 'snap/**'
workflow_dispatch:

jobs:
build-and-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7
- id: snapcraft
uses: snapcore/action-build@v1
- name: Check release tag
if: startsWith(github.ref, 'refs/tags/v')
env:
SNAP_FILE: ${{ steps.snapcraft.outputs.snap }}
run: |
snap_version="$(snap info "$SNAP_FILE" | awk '$1 == "version:" {print $2}')"
test "$GITHUB_REF_NAME" = "v${snap_version}"
- name: Install snap
run: sudo snap install --dangerous "${{ steps.snapcraft.outputs.snap }}"
- name: Test registry, cache, and home access
env:
TEST_IMAGE: busybox:1.36
run: |
first_run="$(olav --resolve-only "docker://${TEST_IMAGE}" 2>&1)"
printf '%s\n' "$first_run"
grep -q '^loaded ' <<< "$first_run"

second_run="$(olav --resolve-only "docker://${TEST_IMAGE}" 2>&1)"
printf '%s\n' "$second_run"
grep -q 'using cached' <<< "$second_run"

cache_path="$(sed -n 's/^loaded .* from //p' <<< "$first_run" | head -n1)"
test -n "$cache_path"
cp -a "$cache_path" "$GITHUB_WORKSPACE/snap-smoke-layout"
olav --resolve-only "$GITHUB_WORKSPACE/snap-smoke-layout"
- uses: actions/upload-artifact@v4
with:
name: olav-snap-amd64
path: ${{ steps.snapcraft.outputs.snap }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/olav
/olav-export/
/*.snap
Loading
Loading