-
Notifications
You must be signed in to change notification settings - Fork 5
153 lines (152 loc) · 4.6 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
---
name: Debian/Ubuntu Package
on:
workflow_dispatch:
pull_request:
paths:
- '**CMakeLists.txt'
- '**.cmake'
- .github/workflows/pack-debian.yml
push:
tags: [v*]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [debian10, ubuntu22.04, ubuntu20.04]
container:
image: ghcr.io/khiopsml/khiops/khiopsdev-${{ matrix.os }}:latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set environment variables
run: |
source /etc/os-release
echo "ID=$ID" >> "$GITHUB_ENV"
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV"
- name: Configure CMake
run: |
cmake --preset linux-gcc-release -DBUILD_JARS=ON
- name: Build Khiops binaries
run: |
cmake --build --preset linux-gcc-release --parallel \
--target MODL MODL_Coclustering KhiopsNativeInterface norm_jar khiops_jar
- name: Build package with CPack
run: cd build/linux-gcc-release && cpack -G DEB
- name: Rename the packages to include the ubuntu codename
run: |
source /etc/os-release
cd build/linux-gcc-release/packages/
for filename in *.deb
do
mv -v $filename ${filename%_*}-${VERSION_CODENAME}.${filename##*_}
done
- name: Upload the packages as artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.ID }}-${{ env.VERSION_CODENAME }}
path: build/linux-gcc-release/packages/*.deb
# Test packages on a brand new runner to check:
# - the installation process (including dependencies installation)
# - that executable works (run with -v)
# - that it executes a small test
test:
needs: build
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: ['debian:10', 'ubuntu:22.04', 'ubuntu:20.04']
container:
image: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set environment variables
run: |
source /etc/os-release
echo "ID=$ID" >> "$GITHUB_ENV"
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV"
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: ${{ env.ID }}-${{ env.VERSION_CODENAME }}
path: artifacts
- name: Install Khiops core
run: |
apt-get update
dpkg -i ./artifacts/khiops-core* || true
apt-get -f install -y
- name: Check Khiops core installation
run: |
khiops-env --env
khiops -v
khiops_coclustering -v
- name: Install Khiops Desktop (with java)
run: |
dpkg -i ./khiops_* || true
apt-get -f install -y
- name: Check Khiops installation
run: |
khiops -v
khiops_coclustering -v
- name: Test Khiops installation
uses: ./.github/actions/test-khiops-install
test-kni:
needs: build
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [debian10, ubuntu22.04, ubuntu20.04]
container:
image: ghcr.io/khiopsml/khiops/khiopsdev-${{ matrix.os }}:latest
steps:
- name: Put OS info on the environment
run: |
source /etc/os-release
echo "ID=$ID" >> "$GITHUB_ENV"
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV"
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: ${{ env.ID }}-${{ env.VERSION_CODENAME }}
path: artifacts
- name: Install KNI Package
run: |
apt-get update
dpkg -i ./artifacts/kni* || true
apt-get -f install -y
- name: Checkout sources
uses: actions/checkout@v3
with:
sparse-checkout: .github
- name: Test KNI package
uses: ./.github/actions/test-kni
release:
needs: [build, test] # TODO: add kni
strategy:
matrix:
os: [debian10, ubuntu22.04, ubuntu20.04]
runs-on: ubuntu-latest
steps:
- name: Put OS info on the environment
run: |
source /etc/os-release
echo "ID=$ID" >> "$GITHUB_ENV"
echo "VERSION_CODENAME=$VERSION_CODENAME" >> "$GITHUB_ENV"
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: ${{ env.ID }}-${{ env.VERSION_CODENAME }}