-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (156 loc) · 6.06 KB
/
pack-debian.yml
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
---
name: DEB Packages
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
image: ['debian:10', 'debian:11', 'debian:12', 'ubuntu:20.04', 'ubuntu:22.04', 'ubuntu:24.04']
container: ${{ matrix.image }}
steps:
- name: Install packages
run: |
export DEBIAN_FRONTEND="noninteractive"
apt-get -y update
apt-get -y --no-install-recommends install build-essential coreutils debhelper git ca-certificates curl
apt-get -y install ninja-build
apt-get -y install zip pkg-config # for vcpkkg
curl -LO "https://github.com/Kitware/CMake/releases/download/v3.30.3/cmake-3.30.3-linux-x86_64.sh"
bash cmake-3.30.3-linux-x86_64.sh --prefix=/usr/local/ --exclude-subdir
- name: Checkout sources
uses: actions/checkout@v4
with:
submodules: true
- name: Configure CMake
run: |
cmake -B builds -S . -G Ninja -D CMAKE_BUILD_TYPE=Release -D CMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake
- name: Build
run: |
cmake --build builds --target khiopsdriver_file_gcs
- name: Build package with CPack
run: cd builds/ && cpack -G DEB
- name: Set environment variables
run: |
source /etc/os-release
echo "ID=$ID" >> "$GITHUB_ENV"
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV"
- name: Rename the packages to include the ubuntu codename
run: |
cd builds/packages/
for filename in *.deb
do
mv -v $filename ${filename%_*}-${VERSION_CODENAME}.${filename##*_}
done
- name: Upload the packages as artifacts
uses: actions/upload-artifact@v4
with:
# We add a `deb-` prefix so we can later recover all artifacts with the pattern `deb-*`
# Note: The more natural pattern `*-deb` or `*` does not work
name: deb-${{ env.ID }}-${{ env.VERSION_CODENAME }}
path: builds/packages/*.deb
if-no-files-found: error
# Test packages on a brand new runner to check:
# - the installation process (including dependencies installation)
# - that executable works (run with -s)
# - that it executes a small test
test:
needs: build
runs-on: ubuntu-latest
env:
DEBIAN_FRONTEND: noninteractive
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: ['debian:10', 'debian:11', 'debian:12', 'ubuntu:20.04', 'ubuntu:22.04', 'ubuntu:24.04']
permissions:
contents: 'read'
id-token: 'write'
container:
image: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set environment variables
run: |
source /etc/os-release
echo "ID=$ID" >> "$GITHUB_ENV"
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV"
echo "MPI_IMPLEMENTATION=${{ inputs.mpi_implementation || 'openmpi' }}" >> "$GITHUB_ENV"
- name: Install curl
run: |
apt-get update
apt-get install -y curl
- name: Download and install Khiops core
run: |
curl -L https://github.com/KhiopsML/khiops/releases/download/10.2.4/khiops-core-${{ env.MPI_IMPLEMENTATION }}_10.2.4-1-${{ env.VERSION_CODENAME }}.amd64.deb --output ./khiops-core.deb
dpkg -i ./khiops-core* || true
apt-get -f install -y
- name: Download artifacts (driver package)
uses: actions/download-artifact@v4
with:
name: deb-${{ env.ID }}-${{ env.VERSION_CODENAME }}
path: artifacts
- name: Install driver
run: dpkg -i ./artifacts/khiops-driver-*.deb
- name: Check Khiops core installation
uses: ./.github/actions/test-khiops-install
# Retrieve google credentials through WIF
# see https://github.com/google-github-actions/auth?tab=readme-ov-file#workload-identity-federation-through-a-service-account
- uses: google-github-actions/auth@v2
with:
service_account: 'khiops-gcs-driver-test-sa@ino-olr-dak-ideal-sbx.iam.gserviceaccount.com'
workload_identity_provider: 'projects/322269704080/locations/global/workloadIdentityPools/github/providers/my-repo'
- name: Test Khiops on Iris dataset
uses: ./.github/actions/test-khiops-on-iris
with:
os-decription: ${{ env.ID }}-${{ env.VERSION_CODENAME }}
# Release is only executed on tags
release:
if: github.ref_type == 'tag'
# We release even if the tests fail (we delete from the release whatever fails manually)
needs: build
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Download package artifacts
uses: actions/download-artifact@v4
with:
# See the upload-artifact step in the build job for the explanation of this pattern
pattern: deb-*
merge-multiple: true
- name: Rename packages with tag version
run: |
# Renames the packge only if the source version differs from the tag
SOURCE_VERSION=$(./scripts/driver-version | sed 's/-/_/')
TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/-/_/')
for PKG_FILE in *.deb
do
NEW_PKG_FILE=$(echo $PKG_FILE | sed "s/_${SOURCE_VERSION}-/_${TAG_VERSION}-/")
if [[ "$PKG_FILE" != "$NEW_PKG_FILE" ]]
then
echo "Renaming '$PKG_FILE' to '$NEW_PKG_FILE'"
mv $PKG_FILE $NEW_PKG_FILE
fi
done
- name: Upload packages to the release
uses: ncipollo/[email protected]
with:
allowUpdates: true
artifacts: '*.deb'
body: |
**This release is for testing purposes only and there is no support for it.**
**Go to https://khiops.org to install the latest supported version.**
draft: false
makeLatest: false
prerelease: true
updateOnlyUnreleased: true