-
Notifications
You must be signed in to change notification settings - Fork 3
80 lines (74 loc) · 2.43 KB
/
e2e.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
68
69
70
71
72
73
74
75
76
77
78
79
80
name: e2e tests azure
on:
workflow_dispatch:
pull_request:
jobs:
build:
name: build binary
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # v15
with:
name: edgelesssys
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build
run: nix build .
test:
name: azure
needs:
- build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- variant: "azure_private"
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # v15
with:
name: edgelesssys
- name: Login to Azure
uses: ./.github/actions/login_azure
with:
azure_credentials: ${{ secrets.UPLOSI_AZURE_E2E_CREDENTIALS }}
- name: Create base name override
id: name
env:
variant: ${{ matrix.variant }}
run: |
uuid=$(cat /proc/sys/kernel/random/uuid)
uuid=${uuid:0:8}
base_name="uplosi_e2e_${variant}_${uuid}"
echo "base_name=${base_name}" | tee -a "$GITHUB_OUTPUT"
mkdir -p ./testdata/uplosi.conf.d
cat <<EOF > ./testdata/uplosi.conf.d/0100-azure.conf
[base]
name = "${base_name}"
EOF
cat ./testdata/uplosi.conf.d/0100-azure.conf
- name: Build minimal image
id: build
run: |
echo "img=$(./hack/build_image.sh)" | tee -a "$GITHUB_OUTPUT"
- name: Run e2e tests
working-directory: ./testdata
env:
variant: ${{ matrix.variant }}
img: ${{ steps.build.outputs.img }}
run: |
nix shell .# --command uplosi upload --enable-variant-glob "${variant}" "${img}"
- name: Delete resource group
if: always()
env:
rg: ${{ steps.name.outputs.base_name }}
run: |
az group delete --name "${rg}" --yes