This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 327
91 lines (82 loc) · 3.08 KB
/
end-to-end.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
81
82
83
84
85
86
87
88
89
90
91
on:
workflow_call:
inputs:
waypoint-binary:
required: true
type: string
waypoint-tar:
required: true
type: string
waypoint-image:
required: true
type: string
waypoint-odr-tar:
required: true
type: string
waypoint-odr-image:
required: true
type: string
jobs:
publish-images:
name: Publish Images
runs-on: ubuntu-latest
outputs:
waypoint-image: ${{ steps.push-waypoint.outputs.waypoint-image }}
waypoint-odr-image: ${{ steps.push-waypoint-odr.outputs.waypoint-odr-image }}
steps:
- name: Download Waypoint Image
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: ${{ inputs.waypoint-tar }}
- name: Download Waypoint ODR Image
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: ${{ inputs.waypoint-odr-tar }}
- name: GHCR Login
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag and Push Waypoint
id: push-waypoint
env:
GHCR_IMAGE_NAME: ghcr.io/hashicorp/waypoint/alpha:${{ github.sha }}
run: |
docker load < ${{ inputs.waypoint-tar }}
docker tag ${{ inputs.waypoint-image }} "${GHCR_IMAGE_NAME}"
docker push "${GHCR_IMAGE_NAME}"
echo "waypoint-image=${{env.GHCR_IMAGE_NAME}}" | tee -a "$GITHUB_OUTPUT"
- name: Tag and Push Waypoint ODR
id: push-waypoint-odr
env:
GHCR_IMAGE_NAME: ghcr.io/hashicorp/waypoint/alpha-odr:${{ github.sha }}
run: |
docker load < ${{ inputs.waypoint-odr-tar }}
docker tag ${{ inputs.waypoint-odr-image }} "${GHCR_IMAGE_NAME}"
docker push "${GHCR_IMAGE_NAME}"
echo "waypoint-odr-image=${{env.GHCR_IMAGE_NAME}}" | tee -a "$GITHUB_OUTPUT"
run_tests:
name: Run End-to-end tests
runs-on: ubuntu-latest
needs: publish-images
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: ${{ inputs.waypoint-binary }}
- name: install waypoint binary
id: install-waypoint
run: |
unzip ${{ inputs.waypoint-binary }}
mkdir -p "$(pwd)/bin"
mv waypoint "$(pwd)/bin/waypoint"
echo "wp-binary=$(pwd)/bin/waypoint" | tee -a "$GITHUB_OUTPUT"
- name: Run Tests
env:
E2E_PLATFORM: Docker
WP_BINARY: ${{ steps.install-waypoint.outputs.wp-binary }}
WP_SERVERIMAGE_UPGRADE: ${{ needs.publish-images.outputs.waypoint-image }}
WP_ODRIMAGE_UPGRADE: ${{ needs.publish-images.outputs.waypoint-odr-image }}
run: ./test-e2e/run-test.sh