-
Notifications
You must be signed in to change notification settings - Fork 72
101 lines (88 loc) · 2.5 KB
/
spread.yaml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Spread
on:
pull_request:
push:
branches:
- main
schedule:
- cron: "0 0 */2 * *"
jobs:
snap-build:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build snap
uses: snapcore/action-build@v1
id: charmcraft
- name: Upload snap artifact
uses: actions/upload-artifact@v3
with:
name: snap
path: ${{ steps.charmcraft.outputs.snap }}
snap-tests:
runs-on: self-hosted
needs: [snap-build]
strategy:
fail-fast: false
matrix:
spread:
- "google:"
# - "google:ubuntu-22.04-64:tests/spread/charms/k8s-operator:prometheus"
steps:
- name: Cleanup job workspace
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- name: Checkout charmcraft
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Download snap artifact
uses: actions/download-artifact@v3
with:
name: snap
- name: Run spread
run: |
spread ${{ matrix.spread }}
snap-store-tests:
runs-on: self-hosted
needs: [snap-build]
steps:
- name: Decision to Run
id: decisions
run: |
# Secrets cannot be used in conditionals, so this is our dance:
# https://github.com/actions/runner/issues/520
if [[ -n "${{ secrets.CHARMCRAFT_AUTH }}" ]]; then
echo "::set-output name=RUN::true"
else
echo "::set-output name=RUN::"
fi
- if: steps.decisions.outputs.RUN == 'true'
name: Cleanup job workspace
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- if: steps.decisions.outputs.RUN == 'true'
name: Checkout charmcraft
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- if: steps.decisions.outputs.RUN == 'true'
name: Download snap artifact
uses: actions/download-artifact@v3
with:
name: snap
- if: steps.decisions.outputs.RUN == 'true'
name: Run spread
env:
CHARMCRAFT_AUTH: ${{ secrets.CHARMCRAFT_AUTH }}
CHARM_DEFAULT_NAME: gh-ci-charmcraft-charm
BUNDLE_DEFAULT_NAME: gh-ci-charmcraft-bundle
run: |
spread google:ubuntu-22.04-64:tests/spread/store/