-
Notifications
You must be signed in to change notification settings - Fork 3
62 lines (52 loc) · 1.42 KB
/
build-rock.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
name: Build and test rock
on:
pull_request:
branches:
- 'core2[24]-[78]'
push:
branches:
- 'core2[24]-[78]'
jobs:
build-rock:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build rock
uses: canonical/craft-actions/rockcraft-pack@main
- name: Get rock name
id: vars
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]
then
echo "rockname=pr-${{ github.event.number }}" >> "$GITHUB_OUTPUT"
else
echo "rockname=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
fi
- name: Upload rock
# NOTE: using v3 (for this and other actions) due to node versions
# on self-hosted runners (no node20)
uses: actions/upload-artifact@v3
with:
name: snapcraft-rock
path: '*.rock'
spread-tests:
runs-on: self-hosted
needs: [build-rock]
steps:
- name: Cleanup job workspace
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Download rock artifact
uses: actions/download-artifact@v3
with:
name: snapcraft-rock
path: tests
- name: Run spread
run: spread