Files
chia-blockchain/.github/workflows/test-install-scripts.yml
T

259 lines
8.7 KiB
YAML

name: Test Install Scripts
on:
push:
branches:
- 'long_lived/**'
- main
- 'release/**'
tags:
- '**'
pull_request:
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
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: [3.9]
os: [macOS-latest, ubuntu-latest]
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python environment
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
run: sh install.sh
- name: Run install-gui script
run: |
. ./activate
sh install-gui.sh
test_scripts_in_docker:
name: Test Install Scripts ${{ matrix.distribution.name }}
runs-on: ${{ matrix.os }}
container: ${{ matrix.distribution.url }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
os: [ubuntu-latest]
distribution:
- name: amazonlinux:2
type: amazon
url: "docker://amazonlinux:2"
- name: arch:latest
type: arch
url: "docker://archlinux:latest"
- name: centos:7
type: centos
url: "docker://centos:7"
# commented out until we decide what to do with this, it fails consistently
# - name: centos:8
# type: centos
# url: "docker://centos:8"
- name: debian:buster
type: debian
# https://packages.debian.org/buster/python/python3 (3.7)
url: "docker://debian:buster"
- 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.10)
url: "docker://debian:bookworm"
- name: fedora:34
type: fedora
# (34, 3.9) https://packages.fedoraproject.org/search?query=python3&releases=Fedora+34&start=0
url: "docker://fedora:34"
- name: fedora:35
type: fedora
# (35, 3.10) https://packages.fedoraproject.org/search?query=python3&releases=Fedora+35&start=0
url: "docker://fedora:35"
- name: fedora:36
type: fedora
# (36, 3.10) https://packages.fedoraproject.org/search?query=python3&releases=Fedora+36&start=0
url: "docker://fedora:36"
- name: rockylinux:8
type: rocky
url: "docker://rockylinux:8"
- name: ubuntu:bionic (18.04)
type: ubuntu
# https://packages.ubuntu.com/bionic/python3.7 (18.04, 3.7)
url: "docker://ubuntu:bionic"
- name: ubuntu:focal (20.04)
type: ubuntu
# https://packages.ubuntu.com/focal/python3 (20.04, 3.8)
url: "docker://ubuntu:focal"
- name: ubuntu:hirsute (21.04)
type: ubuntu
# https://packages.ubuntu.com/hirsute/python3 (21.04, 3.9)
url: "docker://ubuntu:hirsute"
- name: ubuntu:impish (21.10)
type: ubuntu
# https://packages.ubuntu.com/impish/python3 (21.10, 3.9)
url: "docker://ubuntu:impish"
- name: ubuntu:jammy (22.04)
type: ubuntu
# https://packages.ubuntu.com/jammy/python3 (22.04, 3.10)
url: "docker://ubuntu:jammy"
- name: linuxmintd/mint19.1-amd64 (Tessa)
type: mint
# 3.6 default with an option for 3.7
url: "docker://linuxmintd/mint19.1-amd64"
- name: linuxmintd/mint19.2-amd64 (Tina)
type: mint
# 3.6 default with an option for 3.7
url: "docker://linuxmintd/mint19.2-amd64"
- name: linuxmintd/mint19.3-amd64 (Tricia)
type: mint
# 3.6 default with an option for 3.7
url: "docker://linuxmintd/mint19.3-amd64"
- name: linuxmintd/mint20-amd64 (Ulyana)
type: mint
# 3.8
url: "docker://linuxmintd/mint20-amd64"
- name: linuxmintd/mint20.1-amd64 (Ulyssa)
type: mint
# 3.8
url: "docker://linuxmintd/mint20.1-amd64"
- name: linuxmintd/mint20.2-amd64 (Uma)
type: mint
# 3.8
url: "docker://linuxmintd/mint20.2-amd64"
- name: linuxmintd/mint20.3-amd64 (Una)
type: mint
# 3.8
url: "docker://linuxmintd/mint20.3-amd64"
# The Linux Mint 21 docker image reports as 20.3 but has different Python.
# Uncomment after adapting to handle this or upstream fixing it.
# Also, Linux Mint 21 is not released as of this change.
# - name: linuxmintd/mint21-amd64
# type: linuxmint
# # 3.10 default with an option for 3.9
# url: "docker://linuxmintd/mint21-amd64"
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 --refresh base --sync git sudo
# 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.9.9-1-x86_64.pkg.tar.zst
- name: Prepare CentOS
if: ${{ matrix.distribution.type == 'centos' }}
# Installing Git from yum brings git@1.x which doesn't work on actions/checkout.
# So install git@2.x from source
run: |
if [ "$(rpm --eval %{centos_ver})" = "8" ]; then
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*;
fi
yum update -y
yum install -y sudo gcc autoconf make wget curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.29.0.tar.gz
tar zxf git-2.29.0.tar.gz
pushd git-2.29.0
make configure
./configure --prefix=/usr/local
make all
make install
popd
- 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
- 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
- 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
- name: Prepare Linux Mint
if: ${{ matrix.distribution.type == 'mint' }}
env:
DEBIAN_FRONTEND: noninteractive
run: |
# for 19.*
apt-get --yes update
# for 19.3 to avoid
# Setting up software-properties-common (2.0.0.2) ...
# Traceback (most recent call last):
# File "/usr/lib/linuxmint/mintSources/mintSources.py", line 11, in <module>
# import requests
# ModuleNotFoundError: No module named 'requests'
apt-get install --yes python3-requests
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
- 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@v3
with:
fetch-depth: 0
- name: Run install script
env:
INSTALL_PYTHON_VERSION: ${{ matrix.python-version }}
run: sh install.sh -a
- name: Run chia --help
run: |
. ./activate
chia --help