Skip to content

Commit

Permalink
distro stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Oct 21, 2024
1 parent 46f65a4 commit 50969eb
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 55 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/distro_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Linux Distro Tests
on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test-distros:
needs: lint
runs-on: ubuntu-latest
container:
image: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian", "archlinux", "fedora", "gentoo/python", "python:3.10-alpine"]
steps:
- uses: actions/checkout@v4
- name: Install Python and Poetry
run: |
if [ -f /etc/os-release ]; then
. /etc/os-release
if [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "20.04" ]; then
# Add deadsnakes PPA for Python 3.12
apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y python3.12 python3.12-venv python3.12-distutils python3-pip
# Update alternatives to use python3.12
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
update-alternatives --set python3 /usr/bin/python3.12
python3 -m pip install --upgrade pip
python3 -m pip install pipx
elif [ "$ID" = "alpine" ]; then
apk add --no-cache python3 py3-pip
python3 -m pip install --upgrade pip
python3 -m pip install pipx
elif [ "$ID" = "arch" ]; then
pacman -Syu --noconfirm python python-pip pipx
elif [ "$ID" = "fedora" ]; then
dnf install -y python3 python3-pip pipx
elif [ "$ID" = "gentoo" ]; then
# Initialize and sync Gentoo repository
emerge-webrsync
emerge --sync
emerge --update --newuse dev-lang/python dev-python/pipx
else
echo "Unsupported Linux distribution"
exit 1
fi
else
echo "Operating system not recognized"
exit 1
fi
# Add $HOME/.local/bin to PATH
export PATH="$HOME/.local/bin:$PATH"
python3 -m pipx ensurepath
pipx install poetry
- name: Install dependencies
run: |
poetry install
- name: Run tests
run: |
poetry run pytest --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=DEBUG .
55 changes: 0 additions & 55 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,61 +55,6 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./cov.xml
verbose: true
test-distros:
needs: lint
runs-on: ubuntu-latest
container:
image: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu:20.04", "ubuntu:22.04", "ubuntu:24.04", "debian", "archlinux", "fedora", "gentoo/python", "python:3.10-alpine"]
steps:
- uses: actions/checkout@v4
- name: Install Python and Poetry
run: |
if [ -f /etc/os-release ]; then
. /etc/os-release
if [ "$ID" = "ubuntu" ] && [ "$VERSION_ID" = "20.04" ]; then
# Add deadsnakes PPA for Python 3.12
apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:deadsnakes/ppa
apt-get update
apt-get install -y python3.12 python3.12-venv python3.12-distutils python3-pip
# Update alternatives to use python3.12
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
update-alternatives --set python3 /usr/bin/python3.12
python3 -m pip install --upgrade pip
python3 -m pip install pipx
else
apt-get update
apt-get install -y python3 python3-pip pipx
fi
elif [ -f /etc/arch-release ]; then
pacman -Syu --noconfirm python python-pip pipx
elif [ -f /etc/fedora-release ]; then
dnf install -y python3 python3-pip pipx
elif [ -f /etc/gentoo-release ]; then
# Initialize and sync Gentoo repository
emerge-webrsync
emerge --sync
emerge --update --newuse dev-lang/python dev-python/pipx
elif [ -f /etc/alpine-release ]; then
apk add --no-cache python3 py3-pip
python3 -m pip install --upgrade pip
python3 -m pip install pipx
fi
# Add $HOME/.local/bin to PATH
export PATH="$HOME/.local/bin:$PATH"
python3 -m pipx ensurepath
pipx install poetry
- name: Install dependencies
run: |
poetry install
- name: Run tests
run: |
poetry run pytest --reruns 2 -o timeout_func_only=true --timeout 1200 --disable-warnings --log-cli-level=DEBUG .
publish_code:
needs: test
runs-on: ubuntu-latest
Expand Down

0 comments on commit 50969eb

Please sign in to comment.