-
Notifications
You must be signed in to change notification settings - Fork 62
198 lines (198 loc) · 5.83 KB
/
linux-build.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: Linux
on:
push:
branches:
- "main"
- "core-8-branch"
- "core-8-6-branch"
- "revised_text"
tags:
- "core-**"
permissions:
contents: read
defaults:
run:
shell: bash
working-directory: tk/unix
env:
ERROR_ON_FAILURES: 1
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
compiler:
- "gcc"
- "clang"
config:
- ""
- "CFLAGS=-DTK_NO_DEPRECATED=1"
- "--disable-shared"
- "--disable-xft"
- "--disable-xss"
- "--enable-symbols"
steps:
- name: Checkout Tk
uses: actions/checkout@v4
with:
path: tk
- name: Checkout Tcl 8.6
uses: actions/checkout@v4
with:
repository: tcltk/tcl
ref: main
path: tcl
- name: Setup Environment (compiler=${{ matrix.compiler }})
run: |
sudo apt-get install libxss-dev libxft-dev
mkdir "$HOME/install dir"
touch tk/doc/man.macros tk/generic/tkStubInit.c
echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV
echo "CC=$COMPILER" >> $GITHUB_ENV
echo "TOOL_DIR=$(cd tcl/tools;pwd)" >> $GITHUB_ENV
echo "BUILD_CONFIG_ID=$OPTS" >> $GITHUB_ENV
working-directory: "."
env:
CFGOPT: ${{ matrix.config }}
COMPILER: ${{ matrix.compiler }}
OPTS: ${{ matrix.compiler }}${{ matrix.config }}
- name: Configure and Build Tcl
run: |
./configure $CFGOPT "--prefix=$HOME/install dir" || {
cat config.log
echo "::warning::Failure during Tcl Configure"
exit 1
}
make all install || {
echo "::warning::Failure during Tcl Build"
exit 1
}
echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV
working-directory: tcl/unix
- name: Configure (opts=${{ matrix.config }})
run: |
./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || {
cat config.log
echo "::error::Failure during Configure"
exit 1
}
- name: Build
run: |
make binaries libraries || {
echo "::error::Failure during Build"
exit 1
}
- name: Build Test Harness
run: |
make tktest || {
echo "::error::Failure during Build"
exit 1
}
- name: Test-Drive Installation
run: |
make install || {
echo "::error::Failure during Install"
exit 1
}
- name: Create Distribution Package
run: |
make dist || {
echo "::error::Failure during Distribute"
exit 1
}
- name: Convert Documentation to HTML
run: |
make html-tk TOOL_DIR=$TOOL_DIR || {
echo "::error::Failure during Distribute"
exit 1
}
- name: Discover Version ID
if: ${{ env.BUILD_CONFIG_ID == 'gcc' }}
run: |
cd /tmp/dist
echo "VERSION=`ls -d tk* | sed 's/tk//'`" >> $GITHUB_ENV
- name: Upload Source Distribution
if: ${{ env.BUILD_CONFIG_ID == 'gcc' }}
uses: actions/upload-artifact@v4
with:
name: Tk ${{ env.VERSION }} Source distribution (snapshot)
path: |
/tmp/dist/tk*
!/tmp/dist/tk*/html/**
- name: Upload Documentation Distribution
if: ${{ env.BUILD_CONFIG_ID == 'gcc' }}
uses: actions/upload-artifact@v4
with:
name: Tk ${{ env.VERSION }} HTML documentation (snapshot)
path: /tmp/dist/tk*/html
test:
runs-on: ubuntu-22.04
strategy:
matrix:
compiler:
- "gcc"
config:
- ""
- "--disable-xft"
- "--enable-symbols"
steps:
- name: Checkout Tk
uses: actions/checkout@v4
with:
path: tk
- name: Checkout Tcl
uses: actions/checkout@v4
with:
repository: tcltk/tcl
ref: main
path: tcl
- name: Setup Environment (compiler=${{ matrix.compiler }})
run: |
sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev
mkdir "$HOME/install dir"
touch tk/doc/man.macros tk/generic/tkStubInit.c
echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV
echo "CC=$COMPILER" >> $GITHUB_ENV
working-directory: "."
env:
CFGOPT: ${{ matrix.config }}
COMPILER: ${{ matrix.compiler }}
- name: Configure and Build Tcl
run: |
./configure $CFGOPT "--prefix=$HOME/install dir" || {
cat config.log
echo "::warning::Failure during Tcl Configure"
exit 1
}
make all install || {
echo "::warning::Failure during Tcl Build"
exit 1
}
echo "TCL_CONFIG_PATH=`pwd`" >> $GITHUB_ENV
working-directory: tcl/unix
- name: Configure ${{ matrix.config }}
run: |
./configure $CFGOPT --with-tcl=$TCL_CONFIG_PATH "--prefix=$HOME/install dir" || {
cat config.log
echo "::error::Failure during Configure"
exit 1
}
- name: Build
run: |
make binaries libraries tktest || {
echo "::error::Failure during Build"
exit 1
}
- name: Run Tests
run: |
xvfb-run --auto-servernum make test-classic | tee out-classic.txt
xvfb-run --auto-servernum make test-ttk | tee out-ttk.txt
grep -q "Failed 0" out-classic.txt || {
echo "::error::Failure during Test"
exit 1
}
grep -q "Failed 0" out-ttk.txt || {
echo "::error::Failure during Test"
exit 1
}
timeout-minutes: 10