APT ARM64 packages #1032
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test installing our ubuntu and debian ARM64 packages for the latest version. | |
name: APT ARM64 packages | |
"on": | |
schedule: | |
# run daily 0:00 on main branch | |
- cron: '0 0 * * *' | |
pull_request: | |
paths: .github/workflows/apt-arm-packages.yaml | |
push: | |
tags: | |
- '*' | |
branches: | |
- release_test | |
- trigger/package_test | |
jobs: | |
apt_tests: | |
name: APT ARM64 ${{ matrix.image }} PG${{ matrix.pg }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
image: [ "debian:11-slim", "debian:12-slim", "ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04" ] | |
pg: [ 14, 15, 16, 17 ] | |
steps: | |
- name: Setup emulation | |
run: | | |
sudo apt-get update | |
sudo apt-get install qemu binfmt-support qemu-user-static | |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
docker run -d --platform=linux/arm64 --name arm_container arm64v8/${{ matrix.image }} sleep 3600 | |
- name: Add repositories | |
run: | | |
cat <<"EOF" | docker exec -i arm_container bash | |
apt-get update | |
apt-get install -y --no-install-recommends ca-certificates curl \ | |
lsb-release gnupg apt-transport-https sudo postgresql-common | |
yes | /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh | |
curl -s https://packagecloud.io/install/repositories/timescale/timescaledb/script.deb.sh | bash | |
EOF | |
- name: Install timescaledb | |
run: | | |
cat <<"EOF" | docker exec -i arm_container bash | |
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | |
timescaledb-2-postgresql-${{ matrix.pg }} timescaledb-tools | |
timescaledb-tune --quiet --yes | |
EOF | |
- name: List available versions | |
run: | | |
cat <<"EOF" | docker exec -i arm_container bash | |
apt-cache show timescaledb-2-postgresql-${{ matrix.pg }} \ | |
| grep -e Version: -e Depends: \ | |
| tr '\n' ' ' \ | |
| sed -e 's! Version: !\n!g' -e 's!Version: !!' -e 's!$!\n!' | |
EOF | |
- name: Show files in package | |
run: | | |
cat <<"EOF" | docker exec -i arm_container bash | |
dpkg -L timescaledb-2-postgresql-${{ matrix.pg }} | |
EOF | |
- uses: actions/checkout@v4 | |
- name: Read versions | |
id: versions | |
run: | | |
# read expected version from version.config | |
# version will only be a proper version in a release branch so we use update_from_version | |
# as fallback for main | |
if grep '^version = [0-9.]\+$' version.config; then | |
version=$(grep '^version = ' version.config | sed -e 's!^version = !!') | |
else | |
version=$(grep '^update_from_version = ' version.config | sed -e 's!^update_from_version = !!') | |
fi | |
echo "version=${version}" >>$GITHUB_OUTPUT | |
- name: Test Installation | |
run: | | |
cat <<"EOF" | docker exec -i arm_container bash | |
set -e | |
pg_ctlcluster ${{ matrix.pg }} main start | |
sudo -u postgres psql -X -c "CREATE EXTENSION timescaledb" \ | |
-c "SELECT extname,extversion,version() FROM pg_extension WHERE extname='timescaledb'" | |
installed_version=$(sudo -u postgres psql -X -t \ | |
-c "SELECT extversion FROM pg_extension WHERE extname='timescaledb';" \ | |
| sed -e 's! !!g') | |
if [ "${{ steps.versions.outputs.version }}" != "$installed_version" ];then | |
false | |
fi | |
EOF | |
- name: Kill container | |
run: | | |
docker kill arm_container | |