-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (37 loc) · 1.09 KB
/
test.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
name: Tests
on:
workflow_call:
jobs:
tests:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install skopeo
run: |
sudo snap install --devmode --channel edge skopeo
- name: Install yq
run: |
sudo snap install yq
- uses: actions/download-artifact@v3
with:
name: rock
- name: Import
run: |
image_name="$(yq '.name' rockcraft.yaml)"
version="$(yq '.version' rockcraft.yaml)"
rock_file=$(ls *.rock | tail -n 1)
sudo skopeo \
--insecure-policy \
copy \
oci-archive:"${rock_file}" \
docker-daemon:"ghcr.io/canonical/${image_name}:${version}"
- name: Install tox
run: |
pip install tox
- name: Tests
run: |
image_name="$(yq '.name' rockcraft.yaml)"
version="$(yq '.version' rockcraft.yaml)"
docker run -d -p 8080:80 ghcr.io/canonical/${image_name}:${version}
cd tests && tox -e integration