-
Notifications
You must be signed in to change notification settings - Fork 6
131 lines (114 loc) · 4.96 KB
/
Copy pathtest-install-script.yml
File metadata and controls
131 lines (114 loc) · 4.96 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: "Test install.sh (post-release)"
on:
workflow_call:
inputs:
version:
required: true
type: string
jobs:
test_install_script_x86_64:
name: Test install.sh (x86_64)
continue-on-error: true
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { image: "ubuntu:22.04", name: ubuntu-22.04 }
- { image: "ubuntu:24.04", name: ubuntu-24.04 }
- { image: "debian:bookworm", name: debian-bookworm }
- { image: "fedora:42", name: fedora-42 }
- { image: "rockylinux:9", name: rocky-9 }
- { image: "amazonlinux:2023", name: amazonlinux-2023 }
- { image: "alpine:3.21", name: alpine-3.21 }
- { image: "alpine:3.22", name: alpine-3.22 }
- { image: "archlinux:latest", name: archlinux-latest }
steps:
- name: Test install.sh in ${{ matrix.name }}
run: |
set -e
docker run --rm \
${{ matrix.image }} \
/bin/sh -c "
# Install curl or wget (needed by install.sh)
if command -v apt-get > /dev/null 2>&1; then
apt-get update -qq && apt-get install -y -qq curl ca-certificates > /dev/null 2>&1
elif command -v dnf > /dev/null 2>&1; then
dnf install -y curl ca-certificates > /dev/null 2>&1
elif command -v yum > /dev/null 2>&1; then
yum install -y curl ca-certificates > /dev/null 2>&1
elif command -v apk > /dev/null 2>&1; then
apk add --no-cache curl ca-certificates > /dev/null 2>&1
elif command -v pacman > /dev/null 2>&1; then
pacman -Sy --noconfirm curl ca-certificates > /dev/null 2>&1
fi
# Download install.sh from preview endpoint
curl -fsSL https://pkg.phase.dev/install.sh -o /install.sh
echo '=== Running install.sh --version ${{ inputs.version }} ==='
sh /install.sh --version '${{ inputs.version }}'
echo '=== Verify phase exists ==='
command -v phase
echo '=== phase --version ==='
phase --version
echo '=== phase --help (head) ==='
phase --help | head -20
echo '=== version check ==='
RETURNED_VERSION=\$(phase --version | awk '{print \$1}')
if [ \"\$RETURNED_VERSION\" != \"${{ inputs.version }}\" ]; then
echo \"Version mismatch: expected ${{ inputs.version }}, got \$RETURNED_VERSION\"
exit 1
fi
echo 'All checks passed'
"
shell: bash
test_install_script_arm64:
name: Test install.sh (ARM64)
continue-on-error: true
runs-on: ubuntu-22.04-arm
strategy:
fail-fast: false
matrix:
include:
- { image: "ubuntu:24.04", name: ubuntu-24.04 }
- { image: "debian:bookworm", name: debian-bookworm }
- { image: "fedora:42", name: fedora-42 }
- { image: "alpine:3.21", name: alpine-3.21 }
- { image: "amazonlinux:2023", name: amazonlinux-2023 }
steps:
- name: Test install.sh in ${{ matrix.name }} (arm64)
run: |
set -e
docker run --rm \
${{ matrix.image }} \
/bin/sh -c "
# Install curl or wget (needed by install.sh)
if command -v apt-get > /dev/null 2>&1; then
apt-get update -qq && apt-get install -y -qq curl ca-certificates > /dev/null 2>&1
elif command -v dnf > /dev/null 2>&1; then
dnf install -y curl ca-certificates > /dev/null 2>&1
elif command -v yum > /dev/null 2>&1; then
yum install -y curl ca-certificates > /dev/null 2>&1
elif command -v apk > /dev/null 2>&1; then
apk add --no-cache curl ca-certificates > /dev/null 2>&1
elif command -v pacman > /dev/null 2>&1; then
pacman -Sy --noconfirm curl ca-certificates > /dev/null 2>&1
fi
# Download install.sh from preview endpoint
curl -fsSL https://pkg.phase.dev/install.sh -o /install.sh
echo '=== Running install.sh --version ${{ inputs.version }} ==='
sh /install.sh --version '${{ inputs.version }}'
echo '=== Verify phase exists ==='
command -v phase
echo '=== phase --version ==='
phase --version
echo '=== phase --help (head) ==='
phase --help | head -20
echo '=== version check ==='
RETURNED_VERSION=\$(phase --version | awk '{print \$1}')
if [ \"\$RETURNED_VERSION\" != \"${{ inputs.version }}\" ]; then
echo \"Version mismatch: expected ${{ inputs.version }}, got \$RETURNED_VERSION\"
exit 1
fi
echo 'All checks passed'
"
shell: bash