-
Notifications
You must be signed in to change notification settings - Fork 18
80 lines (71 loc) · 2.27 KB
/
Copy pathtest.yml
File metadata and controls
80 lines (71 loc) · 2.27 KB
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
name: Test snap (reusable)
on:
workflow_call:
inputs:
tag:
required: true
type: string
snap-artifact-key:
required: true
type: string
snap-basename:
required: true
type: string
run-id:
type: string
required: false
secrets:
snapcraft-credential:
required: true
github-token:
required: false
jobs:
can-i-run:
env:
ROCKETCHAT_SNAP: ${{ format('/tmp/{0}', inputs.snap-basename) }}
runs-on: ubuntu-latest
steps:
- name: Download snap from another run-id
uses: actions/download-artifact@v4
if: inputs.run-id != ''
with:
repository: RocketChat/server-snap
name: ${{ inputs.snap-artifact-key }}
path: /tmp
run-id: ${{ inputs.run-id }}
github-token: ${{ secrets.github-token || secrets.GITHUB_TOKEN }} # https://github.com/actions/download-artifact/blob/7fba95161a0924506ed1ae69cdbae8371ee00b3f/src/download-artifact.ts#L42-L52
- name: Download snap
uses: actions/download-artifact@v4
if: inputs.run-id == ''
with:
repository: RocketChat/server-snap
name: ${{ inputs.snap-artifact-key }}
path: /tmp
- run: ls /tmp
- name: 'Clone tests repository'
uses: actions/checkout@v3
with:
repository: RocketChat/public-releases
submodules: true
- uses: samuelmeuli/action-snapcraft@v2
name: 'Install snapcraft'
- id: track
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft-credential }}
shell: bash
run: |
track=${{ inputs.tag }}
track=${track:0:1}.x
if ! snapcraft list-revisions rocketchat-server | tail -n '+2' | grep -q "$track/stable"; then
last_channel="$((${track:0:1}-1)).x/stable"
fi
echo "last_channel: $last_channel"
echo "last-channel=$last_channel" >> $GITHUB_OUTPUT
- name: 'Run tests'
shell: bash
env:
ROCKETCHAT_PREVIOUS_CHANNEL: ${{ steps.track.outputs.last-channel}}
ROCKETCHAT_TAG: ${{ inputs.tag }}
run: |
sudo apt-get --no-install-recommends install jo jq -y
bash ./run_snap.bash