-
Notifications
You must be signed in to change notification settings - Fork 2k
245 lines (220 loc) · 7.81 KB
/
test-install-scripts.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
name: 🏗️ Test Install Scripts
on:
push:
paths-ignore:
- "**.md"
branches:
- "long_lived/**"
- main
- "release/**"
release:
types: [published]
pull_request:
paths-ignore:
- "**.md"
branches:
- "**"
concurrency:
# SHA is added to the end if on `main` to let all main workflows run
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true
jobs:
test_scripts:
name: Test Install Scripts - ${{ matrix.development.name }} - ${{ matrix.editable.name }}
runs-on: ${{ matrix.os.runs-on }}
strategy:
fail-fast: false
matrix:
python:
- major-dot-minor: "3.10"
os:
- runs-on: macos-latest
matrix: macos-arm
- runs-on: macos-12
matrix: macos-intel
- runs-on: ubuntu-latest
matrix: linux
- runs-on: windows-latest
matrix: windows
development:
- name: Non-development
value: false
- name: Development
value: true
editable:
- name: Non-editable
value: false
matrix: non-editable
- name: Editable
value: true
matrix: editable
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python environment
uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}
- uses: ./.github/actions/install
with:
python-version: ${{ matrix.python.major-dot-minor }}
development: ${{ matrix.development.value }}
editable: ${{ matrix.editable.value }}
do-system-installs: true
- uses: chia-network/actions/activate-venv@main
- name: Run chia --help
run: |
chia --help
- name: Run install-gui script (Linux, macOS)
if: matrix.os.matrix != 'windows'
run: |
sh install-gui.sh
- name: Run install-gui script (Windows)
if: matrix.os.matrix == 'windows'
run: |
./Install-gui.ps1
- name: Collect editable info
id: editable-info
shell: bash
run: |
echo "pre-edit-version=$(chia version)" >> "$GITHUB_OUTPUT"
echo '__version__ = "shooby-doowah"' >> chia/__init__.py
echo "post-edit-version=$(chia version)" >> "$GITHUB_OUTPUT"
- name: Check editable
if: matrix.editable.matrix == 'editable'
shell: bash
env:
PRE_VERSION: ${{ steps.editable-info.outputs.pre-edit-version }}
POST_VERSION: ${{ steps.editable-info.outputs.post-edit-version }}
run: |
[ "$POST_VERSION" = "shooby-doowah" -a "$PRE_VERSION" != "shooby-doowah" ]
- name: Check non-editable
if: matrix.editable.matrix == 'non-editable'
shell: bash
env:
PRE_VERSION: ${{ steps.editable-info.outputs.pre-edit-version }}
POST_VERSION: ${{ steps.editable-info.outputs.post-edit-version }}
run: |
[ "$POST_VERSION" != "shooby-doowah" -a "$PRE_VERSION" = "$POST_VERSION" ]
test_scripts_in_docker:
name: Test Install Scripts ${{ matrix.distribution.name }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
container: ${{ matrix.distribution.url }}
strategy:
fail-fast: false
matrix:
os:
- name: Linux
matrix: linux
runs-on:
intel: ubuntu-latest
arm: [linux, arm64]
distribution:
- name: amazonlinux:2023
type: amazon
url: "docker://amazonlinux:2023"
- name: arch:latest
type: arch
url: "docker://archlinux:latest"
- name: debian:bullseye
type: debian
# https://packages.debian.org/bullseye/python/python3 (3.9)
url: "docker://debian:bullseye"
- name: debian:bookworm
type: debian
# https://packages.debian.org/bookworm/python/python3 (3.11)
url: "docker://debian:bookworm"
- name: fedora:37
type: fedora
# (37, 3.11) https://packages.fedoraproject.org/search?query=python3&releases=Fedora+37&start=0
url: "docker://fedora:37"
- name: fedora:38
type: fedora
# (38, 3.11) https://packages.fedoraproject.org/search?query=python3&releases=Fedora+38&start=0
url: "docker://fedora:38"
- name: rockylinux:8
type: rocky
url: "docker://rockylinux:8"
- name: rockylinux:9
type: rocky
url: "docker://rockylinux:9"
- name: ubuntu:focal (20.04)
type: ubuntu
# https://packages.ubuntu.com/focal/python3 (20.04, 3.8)
url: "docker://ubuntu:focal"
- name: ubuntu:jammy (22.04)
type: ubuntu
# https://packages.ubuntu.com/jammy/python3 (22.04, 3.10)
url: "docker://ubuntu:jammy"
- name: ubuntu:noble (24.04)
type: ubuntu
# https://packages.ubuntu.com/noble/python3 (24.04, 3.12)
url: "docker://ubuntu:noble"
arch:
- name: ARM64
matrix: arm
- name: Intel
matrix: intel
exclude:
- distribution:
type: arch
arch:
matrix: arm
steps:
- name: Prepare Amazon Linux
if: ${{ matrix.distribution.type == 'amazon' }}
run: |
yum install --assumeyes git sudo
- name: Prepare Arch
if: ${{ matrix.distribution.type == 'arch' }}
run: |
pacman --noconfirm -Syu
pacman --noconfirm -S base git sudo openssl-1.1
# The behavior we follow in install.sh is unique with Arch in that
# we leave it to the user to install the appropriate version of python,
# so we need to install python here in order for the test to succeed.
pacman --noconfirm -U --needed https://archive.archlinux.org/packages/p/python/python-3.11.8-1-x86_64.pkg.tar.zst
- name: Prepare Debian
if: ${{ matrix.distribution.type == 'debian' }}
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get --yes update
apt-get install --yes git lsb-release sudo python3-venv
- name: Prepare Fedora
if: ${{ matrix.distribution.type == 'fedora' }}
run: |
yum install --assumeyes git
- name: Prepare Rocky
if: ${{ matrix.distribution.type == 'rocky' }}
run: |
yum install --assumeyes git sudo python39
- name: Prepare Ubuntu
if: ${{ matrix.distribution.type == 'ubuntu' }}
env:
DEBIAN_FRONTEND: noninteractive
run: |
# for bionic
apt-get --yes update
apt-get install --yes software-properties-common
add-apt-repository --yes ppa:git-core/ppa
apt-get --yes update
apt-get install --yes git lsb-release sudo python3-venv
- name: Add safe git directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
# after installing git so we use that copy
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/install
with:
python-version: ${{ matrix.python-version }}
development: true
do-system-installs: true
- uses: chia-network/actions/activate-venv@main
- name: Run chia --help
run: |
chia --help