Skip to content

Commit 7c8dc20

Browse files
committed
Attempt i386 docker
1 parent b573a14 commit 7c8dc20

File tree

5 files changed

+94
-65
lines changed

5 files changed

+94
-65
lines changed

.github/actions/deps/action.yml

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ runs:
44
steps:
55
- shell: bash
66
run: |
7-
if [ "$ARCH" == "linux-x64" ]; then
7+
if [[ "$ARCH" == linux-* ]]; then
88
sudo apt install bison \
99
re2c \
1010
locales \
@@ -65,47 +65,47 @@ runs:
6565
# Interferes with libldap2 headers.
6666
rm /opt/oracle/instantclient/sdk/include/ldap.h
6767
fi
68-
if [ "$ARCH" == "linux-i386" ]; then
69-
sudo dpkg --add-architecture i386
70-
sudo apt-get update -y | true
71-
sudo apt-get install -y gcc-multilib
72-
sudo apt-get install -y g++-multilib
73-
sudo apt-get purge -y libxml2
74-
# TODO: Reenable postgresql + postgresql-contrib packages once they work again.
75-
sudo apt-get purge -y libpq5
76-
sudo apt-get install -y libc6:i386
77-
sudo apt-get install -y bison \
78-
re2c \
79-
locales \
80-
language-pack-de \
81-
libssl-dev:i386 \
82-
zlib1g-dev:i386 \
83-
libxml2-dev:i386 \
84-
libgmp-dev:i386 \
85-
libicu-dev:i386 \
86-
libtidy-dev:i386 \
87-
libaspell-dev:i386 \
88-
libpspell-dev:i386 \
89-
libsasl2-dev:i386 \
90-
libxpm-dev:i386 \
91-
libjpeg-dev:i386 \
92-
libpng-dev:i386 \
93-
libzip-dev:i386 \
94-
libbz2-dev:i386 \
95-
libsqlite3-dev:i386 \
96-
libwebp-dev:i386 \
97-
libonig-dev:i386 \
98-
libkrb5-dev:i386 \
99-
libgssapi-krb5-2:i386 \
100-
libcurl4-openssl-dev:i386 \
101-
libxml2-dev:i386 \
102-
libxslt1-dev:i386 \
103-
libpq-dev:i386 \
104-
libreadline-dev:i386 \
105-
libffi-dev:i386 \
106-
libfreetype6-dev:i386 \
107-
libsodium-dev:i386
108-
fi
68+
#if [ "$ARCH" == "linux-i386" ]; then
69+
# sudo dpkg --add-architecture i386
70+
# sudo apt-get update -y | true
71+
# sudo apt-get install -y gcc-multilib
72+
# sudo apt-get install -y g++-multilib
73+
# sudo apt-get purge -y libxml2
74+
# # TODO: Reenable postgresql + postgresql-contrib packages once they work again.
75+
# sudo apt-get purge -y libpq5
76+
# sudo apt-get install -y libc6:i386
77+
# sudo apt-get install -y bison \
78+
# re2c \
79+
# locales \
80+
# language-pack-de \
81+
# libssl-dev:i386 \
82+
# zlib1g-dev:i386 \
83+
# libxml2-dev:i386 \
84+
# libgmp-dev:i386 \
85+
# libicu-dev:i386 \
86+
# libtidy-dev:i386 \
87+
# libaspell-dev:i386 \
88+
# libpspell-dev:i386 \
89+
# libsasl2-dev:i386 \
90+
# libxpm-dev:i386 \
91+
# libjpeg-dev:i386 \
92+
# libpng-dev:i386 \
93+
# libzip-dev:i386 \
94+
# libbz2-dev:i386 \
95+
# libsqlite3-dev:i386 \
96+
# libwebp-dev:i386 \
97+
# libonig-dev:i386 \
98+
# libkrb5-dev:i386 \
99+
# libgssapi-krb5-2:i386 \
100+
# libcurl4-openssl-dev:i386 \
101+
# libxml2-dev:i386 \
102+
# libxslt1-dev:i386 \
103+
# libpq-dev:i386 \
104+
# libreadline-dev:i386 \
105+
# libffi-dev:i386 \
106+
# libfreetype6-dev:i386 \
107+
# libsodium-dev:i386
108+
#fi
109109
if [ "$ARCH" == "macos" ]; then
110110
brew install pkg-config \
111111
autoconf \
@@ -132,4 +132,4 @@ runs:
132132
libxslt \
133133
postgresql
134134
brew link icu4c gettext --force
135-
fi
135+
fi

.github/actions/mssql/action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ runs:
44
steps:
55
- shell: bash
66
run: |
7+
apt-get update
8+
apt-get -y install sudo
9+
10+
# Install docker to when running inside a container
11+
echo $DOCKER_CONTAINER
12+
13+
apt-get update
14+
apt install -y curl
15+
curl https://gitlab.com/docker-32bit/ubuntu/raw/master/build-image.sh | bash
16+
717
docker run \
818
-e "ACCEPT_EULA=Y" \
919
-e "SA_PASSWORD=<YourStrong@Passw0rd>" \

.github/generate_ci.php

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,34 +39,37 @@ function generate_push(): void {
3939
'matrix' => [
4040
'include' => [
4141
// [
42-
// 'arch' => 'linux-x64',
42+
// 'arch' => ['name' => 'linux-x64', 'container' => null],
4343
// 'debug' => true,
4444
// 'zts' => false,
4545
// ],
4646
// [
47-
// 'arch' => 'linux-x64',
47+
// 'arch' => ['name' => 'linux-x64', 'container' => null],
4848
// 'debug' => false,
4949
// 'zts' => true,
5050
// ],
51-
// apt broken, not sure why
52-
// [
53-
// 'arch' => 'linux-i386',
54-
// 'debug' => true,
55-
// 'zts' => true,
56-
// ],
5751
[
58-
'arch' => 'macos',
52+
'arch' => ['name' => 'linux-i386', 'container' => 'i386/ubuntu:latest'],
5953
'debug' => true,
60-
'zts' => false,
54+
'zts' => true,
6155
],
56+
// [
57+
// 'arch' => ['name' => 'macos', 'container' => null],
58+
// 'debug' => true,
59+
// 'zts' => false,
60+
// ],
6261
]
6362
],
6463
'fail-fast' => false,
6564
],
6665
// Generate
67-
'name' => "\${{ matrix.arch }}-\${{ matrix.debug && 'debug' || 'release' }}-\${{ matrix.zts && 'zts' || 'nts' }}",
68-
'runs-on' => "\${{ startsWith(matrix.arch, 'linux-') && 'ubuntu-20.04' || 'macOS-10.15' }}",
69-
'env' => ['ARCH' => '${{ matrix.arch }}'],
66+
'name' => "\${{ matrix.arch.name }}-\${{ matrix.debug && 'debug' || 'release' }}-\${{ matrix.zts && 'zts' || 'nts' }}",
67+
'runs-on' => "\${{ startsWith(matrix.arch.name, 'linux-') && 'ubuntu-20.04' || 'macOS-10.15' }}",
68+
'container' => '${{ matrix.arch.container }}',
69+
'env' => [
70+
'ARCH' => '${{ matrix.arch.name }}',
71+
'DOCKER_CONTAINER' => '${{ matrix.arch.container }}',
72+
],
7073
'steps' => [
7174
step_checkout(),
7275
step_mssql(),
@@ -85,7 +88,9 @@ function generate_push(): void {
8588
}
8689

8790
function step_checkout(?string $branch = null): array {
88-
$step = ['name' => 'git checkout', 'uses' => 'actions/checkout@v2'];
91+
// actions/checkout@v2 doesn't work in docker containers which is used for i386 builds
92+
// https://github.com/actions/checkout/issues/334
93+
$step = ['name' => 'git checkout', 'uses' => 'actions/checkout@v1', 'with' => ['fetch-depth' => 1]];
8994
if ($branch !== null) $step['with']['ref'] = $branch;
9095
return $step;
9196
}
@@ -121,7 +126,7 @@ function step_make_install(): array {
121126
}
122127
123128
function step_setup(): array {
124-
return ['name' => 'Setup', 'uses' => './.github/actions/setup'];
129+
return ['name' => 'Setup', 'if' => "env.ARCH != 'macos'", 'uses' => './.github/actions/setup'];
125130
}
126131
127132
function step_tests(bool $extended = false): array {

.github/workflows/push.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,25 @@ jobs:
2323
strategy:
2424
matrix:
2525
include:
26-
- arch: macos
26+
- arch:
27+
name: linux-i386
28+
container: i386/ubuntu:latest
2729
debug: true
28-
zts: false
30+
zts: true
2931
fail-fast: false
30-
name: ${{ matrix.arch }}-${{ matrix.debug && 'debug' || 'release' }}-${{ matrix.zts
31-
&& 'zts' || 'nts' }}
32-
runs-on: ${{ startsWith(matrix.arch, 'linux-') && 'ubuntu-20.04' || 'macOS-10.15'
32+
name: ${{ matrix.arch.name }}-${{ matrix.debug && 'debug' || 'release' }}-${{
33+
matrix.zts && 'zts' || 'nts' }}
34+
runs-on: ${{ startsWith(matrix.arch.name, 'linux-') && 'ubuntu-20.04' || 'macOS-10.15'
3335
}}
36+
container: ${{ matrix.arch.container }}
3437
env:
35-
ARCH: ${{ matrix.arch }}
38+
ARCH: ${{ matrix.arch.name }}
39+
DOCKER_CONTAINER: ${{ matrix.arch.container }}
3640
steps:
3741
- name: git checkout
38-
uses: actions/checkout@v2
42+
uses: actions/checkout@v1
43+
with:
44+
fetch-depth: 1
3945
- name: Create mssql container
4046
if: env.ARCH != 'macos'
4147
uses: ./.github/actions/mssql
@@ -56,6 +62,7 @@ jobs:
5662
- name: make install
5763
uses: ./.github/actions/install
5864
- name: Setup
65+
if: env.ARCH != 'macos'
5966
uses: ./.github/actions/setup
6067
- name: Test
6168
uses: ./.github/actions/test

test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
export ARCH=macos
4+
5+
if [[ "$ARCH" == linux-* ]]; then
6+
echo "Test"
7+
fi

0 commit comments

Comments
 (0)