-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (98 loc) · 3.74 KB
/
multiplatform_build.yaml
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
---
name: Multiplatform Build
on:
push:
branches:
- "*"
schedule:
- cron: 0 12 * * 6
workflow_dispatch:
concurrency:
group: ${{ github.action_path }}-${{ github.ref }}-multiplatform-build
cancel-in-progress: false
jobs:
multiplatform-build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, windows-2019, windows-2022]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/[email protected]
- if: startsWith(matrix.os, 'windows')
name: Install LLVM and Clang
uses: KyleMayes/[email protected]
with:
version: "18"
arch: "x64"
env: true
- if: startsWith(matrix.os, 'ubuntu')
name: Install ubuntu specific dependencies
run: |
sudo add-apt-repository universe
sudo add-apt-repository restricted
sudo add-apt-repository multiverse
sudo apt-get update
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm \
libncurses5-dev libncursesw5-dev xz-utils tk-dev \
libffi-dev liblzma-dev python3-openssl git
gcc --version
clang --version
- if: endsWith(matrix.os, '20.04')
name: Install ubuntu-20.04 specific dependencies
run: |
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y libtinfo5
gcc --version
- if: endsWith(matrix.os, '22.04')
name: Install ubuntu-22.04 specific dependencies
run: |
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y libtinfo5
gcc --version
- if: endsWith(matrix.os, '24.04')
name: Install ubuntu-24.04 specific dependencies
run: |
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ jammy main"
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ jammy universe"
sudo add-apt-repository "deb http://mirrors.kernel.org/ubuntu/ jammy multiverse"
sudo apt-get update
sudo apt-get install -y libtinfo5
gcc --version
- if: startsWith(matrix.os, 'windows')
name: Install Python dependencies
run: |
chcp 65001 #set code page to utf-8
- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"
- name: Install Poetry
run: pip install poetry==1.8.3
- name: Install project dependencies
run: poetry install --no-cache --sync --no-root
- name: Build distribution package
run: poetry build --format wheel
- uses: actions/upload-artifact@v4
with:
name: build-${{ github.sha }}-${{ matrix.os }}-${{ matrix.python-version }}
path: ./dist/*
- if: startsWith(matrix.os, 'ubuntu')
name: Add virtual environment binaries to PATH
run: echo echo "$(poetry env info --path)/bin" >> "$GITHUB_PATH
- if: startsWith(matrix.os, 'windows')
name: Add virtual environment binaries to PATH
run: echo echo "$(poetry env info --path)/Scripts" >> "$GITHUB_PATH
- name: Run unit tests
run: poetry run poe ctest