From 3bc5bef6c5dbc23cbc99726a3ff52bdb50df6626 Mon Sep 17 00:00:00 2001 From: dumol Date: Thu, 1 Aug 2024 14:24:05 +0000 Subject: [PATCH] Try building ARM64 Linux package on macOS. --- .github/workflows/docker.yaml | 72 +++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 16c7cbccf..1336451ba 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -20,10 +20,76 @@ env: USER: chevah CHEVAH_CONTAINER: yes -# Using a job name that doesn't contain the OS name, to minimize the risk of -# confusion with the OS names of the containers, which are the relevant ones. jobs: - latest: + + arm64: + runs-on: macos-latest + container: amazonlinux-2 + strategy: + fail-fast: false + + timeout-minutes: 30 + steps: + - name: Prepare OS + run: yum -y install git-core gcc make m4 patch tar unzip perl perl-Test-Simple xz gcc-c++ dejagnu + + # On a Docker container, everything runs as root by default. + - name: Chevah user setup + run: | + useradd -g adm -s /bin/bash -m chevah + # Don't just add to the file, reset it, as some default options might + # be detrimental to our testing, e.g. CentOS 5's "requiretty" option. + echo '%adm ALL=NOPASSWD: ALL' > /etc/sudoers + + # GHA's checkout action doesn't work on exotic platforms. This fails on opening a new PR. + - name: Clone sources independently + run: | + cd /home/chevah/ + git init $CHEVAH_REPO + cd $CHEVAH_REPO + # Cleanup the repo. + git rev-parse --symbolic-full-name --verify --quiet HEAD || true + git rev-parse --symbolic-full-name --branches || true + git remote remove origin || true + # Update repo token. + git remote add origin https://github.com/chevah/$CHEVAH_REPO + git fetch --no-tags --prune origin + # Prepare the code. + git clean -f + git reset --hard ${{ github.event.after }} + git log -1 --format='%H' + + - name: Detect OS and build Python + run: | + cd /home/chevah/$CHEVAH_REPO + ./brink.sh detect_os + ./chevah_build build + + - name: Own tests + run: | + cd /home/chevah/$CHEVAH_REPO + ./chevah_build test + + # Compat tests must run as regular user with sudo rights. + - name: Compat tests + run: | + chown -R chevah /home/chevah/$CHEVAH_REPO + cd /home/chevah/$CHEVAH_REPO + true su chevah -c "./chevah_build compat" + + # Using `~/` is problematic under Docker, use `/root/`. + - name: Upload testing package + run: | + mkdir -pv /root/.ssh/ + cd /home/chevah/$CHEVAH_REPO + touch priv_key + chmod 600 priv_key + echo "${{ secrets.SFTPPLUS_BIN_PRIV_KEY }}" > priv_key + echo "${{ secrets.SFTPPLUS_BIN_HOST_KEY }}" > /root/.ssh/known_hosts + ./publish_dist.sh + rm priv_key + + x64: runs-on: ubuntu-latest container: ${{ matrix.container }} strategy: