-
Notifications
You must be signed in to change notification settings - Fork 3
67 lines (56 loc) · 1.54 KB
/
build-and-test-snap.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Snap Tester
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allow manual trigger
workflow_dispatch:
jobs:
build:
outputs:
snap: ${{ steps.snapcraft.outputs.snap }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build snap
uses: snapcore/action-build@v1
id: snapcraft
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.snapcraft.outputs.snap }}
path: ${{ steps.snapcraft.outputs.snap }}
if-no-files-found: error
test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true
- name: Download locally built snap
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.snap }}
- name: Run tests
shell: bash
working-directory: tests
env:
SKIP_TEARDOWN_REMOVAL: true
LOCAL_SERVICE_SNAP: ../${{ needs.build.outputs.snap }}
run: |
go test -failfast -p 1 -timeout 30m -v
# # Print error logs from snap(s)
# - if: failure()
# shell: bash
# working-directory: ${{github.workspace}}/src/test
# run: ./print-errors.sh ${{inputs.name}}
- name: Upload snap logs
if: always()
uses: actions/upload-artifact@v4
with:
name: logs
path: tests/*.log