From 9cfd4b91e9014396b4b7dd4890610a33c156a0a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Sat, 5 Dec 2020 23:04:11 +0700 Subject: [PATCH 1/2] Retire obsolete distros on GitHub Actions & Travis --- .github/workflows/ci.yml | 18 --- .travis.yml | 22 --- ci.sh | 322 --------------------------------------- 3 files changed, 362 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afc612c301..6c1cd9d061 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,21 +100,3 @@ jobs: env: # Should match 'name:' up above JOB_NAME: 'macOS (${{ matrix.python }})' - - Alpine: - name: 'Alpine' - timeout-minutes: 10 - runs-on: 'ubuntu-latest' - container: 'alpine' - strategy: - fail-fast: false - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Install bash - run: apk add --no-cache bash - - name: Run tests - run: ./ci.sh - env: - # Should match 'name:' up above - JOB_NAME: 'Alpine' diff --git a/.travis.yml b/.travis.yml index 911834d76d..43e24c8b9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,28 +11,6 @@ jobs: env: PYPY_NIGHTLY_BRANCH=py3.6 - language: generic env: PYPY_NIGHTLY_BRANCH=py3.7 - # Qemu tests are also slow - # FreeBSD: - - language: generic - env: - - "JOB_NAME='FreeBSD 12.1-RELEASE, full VM'" - - "FREEBSD_INSTALLER_ISO_XZ=https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/12.1/FreeBSD-12.1-RELEASE-amd64-disc1.iso.xz" - # Increment this each time you change the image build code in - # ci.sh and want to intentionally bust the cache. - - "CACHE_GEN=3" - cache: - directories: - - travis-cache - # More recent Ubuntu: - # The unique thing this provides is testing on the given distro's - # kernel, which is important when we use new kernel features. This - # is also good for testing the latest openssl etc., and getting - # early warning of any issues that might happen in the next Ubuntu - # LTS. - - language: generic - env: - - "JOB_NAME='Fedora 32, full VM'" - - "LINUX_VM_IMAGE=https://download.fedoraproject.org/pub/fedora/linux/releases/32/Cloud/x86_64/images/Fedora-Cloud-Base-32-1.6.x86_64.qcow2" - python: 3.6.1 # earliest 3.6 version available on Travis # https://github.com/pypa/setuptools/issues/2350 diff --git a/ci.sh b/ci.sh index 1386e15280..c48062a501 100755 --- a/ci.sh +++ b/ci.sh @@ -29,14 +29,6 @@ function curl-harder() { # Bootstrap python environment, if necessary ################################################################ -### Alpine ### - -if [ -e /etc/alpine-release ]; then - apk add --no-cache gcc musl-dev libffi-dev openssl-dev python3-dev curl - python3 -m venv venv - source venv/bin/activate -fi - ### PyPy nightly (currently on Travis) ### if [ "$PYPY_NIGHTLY_BRANCH" != "" ]; then @@ -67,320 +59,6 @@ if [ "$PYPY_NIGHTLY_BRANCH" != "" ]; then source testenv/bin/activate fi -### FreeBSD-in-Qemu virtual-machine inception, on Travis - -# This is complex, because none of the pre-made images are set up to be -# controlled by an automatic process – making them do anything requires a -# human to look at the screen and type stuff. So we hack up an install CD, run -# it to build our own custom image, and use that. But that's slow and we don't -# want to do it every run, so we try to get Travis to cache the image for us. -# -# Additional subtlety: we actually re-use the same image in-place, and let -# Travis re-cache it every time. The point of this is that it saves our system -# packages + pip cache, so we don't have to re-fetch them from scratch every -# time. (In particular, this means that the first time we install a given -# version of cryptography, we have to build it from source, but on subsequent -# runs we'll have a pre-built wheel sitting in our disk image.) -# -# You can run this locally for testing. But some things to watch out for: -# -# - It'll modify /etc/exports on your host machine. You might want to clean -# it up after. -# - It'll create a symlink at /host-files on your host machine. You might want -# to clean it up after. -# - If you don't want to keep downloading the installer ISO over and over, -# then drop an unpacked copy at ./local-freebsd-installer.iso - -if [ "$FREEBSD_INSTALLER_ISO_XZ" != "" ]; then - sudo apt update - sudo apt install qemu-system-x86 qemu-utils nfs-kernel-server - - if [ ! -e travis-cache/image.qcow2 ]; then - echo "--- No cached FreeBSD VM image; recreating from scratch ---" - sudo apt install growisofs genisoimage - rm -rf scratch - mkdir scratch - qemu-img create -f qcow2 scratch/image.qcow2 10G - if [ -e local-freebsd-installer.iso ]; then - cp local-freebsd-installer.iso scratch/installer.iso - else - curl-harder "$FREEBSD_INSTALLER_ISO_XZ" -o scratch/installer.iso.xz - unxz scratch/installer.iso.xz - fi - - # Files that we want to add to the ISO, to convert it into an - # unattended-installer: - mkdir -p scratch/overlay/etc - mkdir -p scratch/overlay/boot - # Use serial console, and disable the normal 10 second pause before - # booting - cat >scratch/overlay/boot/loader.conf.local <scratch/overlay/etc/rc.local <scratch/overlay/etc/installerconfig <> /etc/rc.conf -/bin/cp /usr/share/zoneinfo/UTC /etc/localtime - -echo 'autoboot_delay=0' >> /boot/loader.conf.local -echo 'console=comconsole' >> /boot/loader.conf.local - -dhclient em0 -export ASSUME_ALWAYS_YES=true -pkg install bash curl python38 py38-sqlite3 - -mkdir /host-files -cat >>/etc/rc.local <freebsd-wrapper.sh < Date: Sat, 5 Dec 2020 22:22:30 +0700 Subject: [PATCH 2/2] Employ builds.sr.ht for Alpine, Fedora and FreeBSD --- .builds/alpine.yml | 19 +++++++++++++++++++ .builds/fedora.yml | 14 ++++++++++++++ .builds/freebsd.yml | 17 +++++++++++++++++ ci.sh | 1 + 4 files changed, 51 insertions(+) create mode 100644 .builds/alpine.yml create mode 100644 .builds/fedora.yml create mode 100644 .builds/freebsd.yml diff --git a/.builds/alpine.yml b/.builds/alpine.yml new file mode 100644 index 0000000000..f69280d852 --- /dev/null +++ b/.builds/alpine.yml @@ -0,0 +1,19 @@ +image: alpine/latest +packages: + - curl + - gcc + - libffi-dev + - musl-dev + - openssl-dev + - python3-dev +sources: + - https://github.com/python-trio/trio +tasks: + - test: | + python3 -m venv venv + source venv/bin/activate + cd trio + CI_BUILD_ID=$JOB_ID CI_BUILD_URL=$JOB_URL ./ci.sh +environment: + CODECOV_TOKEN: 87cefb17-c44b-4f2f-8b30-1fff5769ce46 + JOB_NAME: Alpine diff --git a/.builds/fedora.yml b/.builds/fedora.yml new file mode 100644 index 0000000000..133cf3d40f --- /dev/null +++ b/.builds/fedora.yml @@ -0,0 +1,14 @@ +image: fedora/rawhide +packages: + - python3-pip +sources: + - https://github.com/python-trio/trio +tasks: + - test: | + python3 -m venv venv + source venv/bin/activate + cd trio + CI_BUILD_ID=$JOB_ID CI_BUILD_URL=$JOB_URL ./ci.sh +environment: + CODECOV_TOKEN: 87cefb17-c44b-4f2f-8b30-1fff5769ce46 + JOB_NAME: Fedora diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml new file mode 100644 index 0000000000..34e95cb099 --- /dev/null +++ b/.builds/freebsd.yml @@ -0,0 +1,17 @@ +image: freebsd/latest +packages: + - curl + - python38 + - py38-sqlite3 +sources: + - https://github.com/python-trio/trio +tasks: + - setup: sudo ln -s /usr/local/bin/bash /bin/bash + - test: | + python3.8 -m venv venv + source venv/bin/activate + cd trio + CI_BUILD_ID=$JOB_ID CI_BUILD_URL=$JOB_URL ./ci.sh +environment: + CODECOV_TOKEN: 87cefb17-c44b-4f2f-8b30-1fff5769ce46 + JOB_NAME: FreeBSD diff --git a/ci.sh b/ci.sh index c48062a501..430bfcff00 100755 --- a/ci.sh +++ b/ci.sh @@ -3,6 +3,7 @@ set -ex -o pipefail # Log some general info about the environment +uname -a env | sort if [ "$JOB_NAME" = "" ]; then