Skip to content

Commit ec31def

Browse files
committed
ci: refactor: update ci-test-release.yml
1 parent db82213 commit ec31def

File tree

1 file changed

+47
-26
lines changed

1 file changed

+47
-26
lines changed

.github/workflows/ci-test-release.yml

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Test Release
2+
13
on:
24
workflow_run:
35
workflows: ["Release"]
@@ -44,34 +46,29 @@ jobs:
4446
fail-fast: false
4547
matrix:
4648
distro:
47-
- ubuntu:20.04
4849
- ubuntu:22.04
4950
- ubuntu:24.04
50-
- debian:11
5151
- debian:12
5252
- fedora:38
5353
- fedora:39
54-
- rockylinux:8
55-
- rockylinux:9
5654
- archlinux:latest
57-
- alpine:latest
5855

5956
container:
6057
image: ${{ matrix.distro }}
6158

6259
steps:
63-
- name: Install curl and ca-certificates
60+
- name: Install curl, ca-certificates, and git
6461
run: |
6562
if command -v apt-get &> /dev/null; then
66-
apt-get update && apt-get install -y curl ca-certificates
63+
apt-get update && apt-get install -y curl ca-certificates git
6764
elif command -v dnf &> /dev/null; then
68-
dnf install -y curl ca-certificates
65+
dnf install -y curl ca-certificates git
6966
elif command -v yum &> /dev/null; then
70-
yum install -y curl ca-certificates
67+
yum install -y curl ca-certificates git
7168
elif command -v pacman &> /dev/null; then
72-
pacman -Sy --noconfirm curl ca-certificates
69+
pacman -Sy --noconfirm curl ca-certificates git
7370
elif command -v apk &> /dev/null; then
74-
apk add --no-cache curl ca-certificates
71+
apk add --no-cache curl ca-certificates git
7572
fi
7673
shell: sh
7774

@@ -137,9 +134,6 @@ jobs:
137134
- runner: macos-12
138135
arch: amd64
139136
name: macOS 12 Intel
140-
- runner: macos-13
141-
arch: amd64
142-
name: macOS 13 Intel
143137
- runner: macos-14
144138
arch: arm64
145139
name: macOS 14 Apple Silicon
@@ -290,30 +284,46 @@ jobs:
290284
ar-infra init --help
291285
292286
test-pypi-installation-linux-distros:
293-
name: Test PyPI - ${{ matrix.distro }} (Python ${{ matrix.python-version }})
287+
name: Test PyPI - ${{ matrix.distro-name }}
294288
needs: check-release-success
295289
if: needs.check-release-success.outputs.should_run == 'true'
296290
runs-on: ubuntu-latest
297291
strategy:
298292
fail-fast: false
299293
matrix:
300-
distro:
301-
- ubuntu:22.04
302-
- debian:12
303-
- fedora:39
304-
python-version: ["3.11", "3.12"]
294+
include:
295+
- distro: ubuntu:22.04
296+
distro-name: Ubuntu 22.04
297+
python-pkg: python3.11
298+
pip-pkg: python3-pip python3.11-venv pipx
299+
use-pipx: true
300+
- distro: ubuntu:24.04
301+
distro-name: Ubuntu 24.04
302+
python-pkg: python3.12
303+
pip-pkg: python3-pip python3.12-venv pipx
304+
use-pipx: true
305+
- distro: debian:12
306+
distro-name: Debian 12
307+
python-pkg: python3.11
308+
pip-pkg: python3-pip python3-venv pipx
309+
use-pipx: true
310+
- distro: fedora:39
311+
distro-name: Fedora 39
312+
python-pkg: python3.12
313+
pip-pkg: python3-pip
314+
use-pipx: false
305315

306316
container:
307317
image: ${{ matrix.distro }}
308318

309319
steps:
310-
- name: Install Python and pip
320+
- name: Install Python, pip, and git
311321
run: |
312322
if command -v apt-get &> /dev/null; then
313323
apt-get update
314-
apt-get install -y python${{ matrix.python-version }} python3-pip
324+
apt-get install -y ${{ matrix.python-pkg }} ${{ matrix.pip-pkg }} git
315325
elif command -v dnf &> /dev/null; then
316-
dnf install -y python${{ matrix.python-version }} python3-pip
326+
dnf install -y ${{ matrix.python-pkg }} ${{ matrix.pip-pkg }} git
317327
fi
318328
shell: sh
319329

@@ -323,10 +333,21 @@ jobs:
323333
sleep 60
324334
shell: sh
325335

326-
- name: Install from PyPI
336+
- name: Install from PyPI (Debian with pipx)
337+
if: matrix.use-pipx == true
338+
run: |
339+
export PIPX_HOME=/opt/pipx
340+
export PIPX_BIN_DIR=/usr/local/bin
341+
pipx install ar-infra-cli
342+
shell: sh
343+
344+
- name: Install from PyPI (Non-Debian)
345+
if: matrix.use-pipx == false
327346
run: |
328-
python${{ matrix.python-version }} -m pip install --upgrade pip
329-
python${{ matrix.python-version }} -m pip install ar-infra-cli
347+
python3 -m pip install --upgrade pipx --break-system-packages 2>/dev/null || python3 -m pip install --upgrade pip pipx
348+
export PIPX_HOME=/opt/pipx
349+
export PIPX_BIN_DIR=/usr/local/bin
350+
pipx install ar-infra-cli
330351
shell: sh
331352

332353
- name: Test installation

0 commit comments

Comments
 (0)