-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (118 loc) · 3.5 KB
/
containers.yml
File metadata and controls
135 lines (118 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Containers
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
get_version:
name: Get version info
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
shell: bash
outputs:
version: ${{ steps.git_ver.outputs.version }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get package version
id: git_ver
run: |
version=$(git describe --tags | sed -e "s|v||" -e "s|-g|+g|")
echo "Version from git: ${version}"
echo "version=${version}" >> $GITHUB_OUTPUT
extra_distros:
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
image:
- debian:bookworm
- debian:sid
- fedora:latest
- fedora:rawhide
- rockylinux:9
include:
- image: debian:bookworm
pkgs: python3.11-venv
py3: python3
- image: debian:sid
pkgs: python3.13-venv
py3: python3
- image: fedora:latest
pkgs: python3-devel python3-pip
py3: python3
- image: rockylinux:9
pkgs: python3-devel python3-pip
py3: python3
- image: fedora:rawhide
pkgs: python3.13 python3-pip
py3: python3.13
runs-on: ubuntu-latest
needs: [get_version]
container:
image: ${{ matrix.image }}
permissions:
contents: read
defaults:
run:
shell: bash
env:
PYTHONIOENCODING: utf-8
steps:
- name: Check github variables
env:
VERSION: ${{ needs.get_version.outputs.version }}
run: |
echo "Package version from git: ${VERSION}"
- uses: actions/checkout@v6
with:
fetch-depth: 0
# Work-around for https://github.com/actions/runner-images/issues/6775
- name: Change Owner of Container Working Directory
if: matrix.image
run: chown root.root .
- name: Deps for python (debs)
if: startsWith(matrix.image, 'deb')
run: |
apt-get -qq update
apt-get install -yqq git wget sudo ${{matrix.pkgs}} python-is-python3 python3 python3-pip
- name: Deps for python (rh/rocky)
if: (startsWith(matrix.image, 'roc') || startsWith(matrix.image, 'fed'))
run: |
dnf search --refresh epel
dnf install -y git wget sudo libcap ${{matrix.pkgs}} rpm-build
- name: Setup python (rawhide only)
if: matrix.image == 'fedora:rawhide'
run: |
sudo ln -sf /usr/bin/python3.13 /usr/bin/python3
sudo alternatives --install /usr/bin/python python /usr/bin/python3.13 2
sudo alternatives --install /usr/bin/python python /usr/bin/python3.14 1
alternatives --help
python --version
- name: Manually create pip cache dir
run: mkdir -p ~/.cache/pip
- uses: actions/cache@v5
id: cache
env:
cache-name: cache-pip
with:
path: ~/.cache
key: ${{ matrix.image }}-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ matrix.image }}-${{ env.cache-name }}-
- name: Install dependencies
run: |
${{matrix.py3}} -m venv .venv
.venv/bin/pip3 install --upgrade pip wheel setuptools
.venv/bin/pip3 install tox
- name: Build dist pkgs
run: |
.venv/bin/tox -e build,check
env:
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ needs.get_version.outputs.version }}