Skip to content

Commit d73c280

Browse files
committed
Add GitHub Actions CI
1 parent 6f6f85e commit d73c280

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build and Test
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
# XXX: macOS
11+
ubuntu:
12+
strategy:
13+
matrix:
14+
version: ['7.3', '7.4', '8.0', '8.1']
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
- name: Cache DB2 library
20+
id: cache-clidriver
21+
uses: actions/cache@v2
22+
with:
23+
path: clidriver
24+
key: ${{ runner.os }}-clidriver
25+
- name: Install DB2 library
26+
if: steps.cache-clidriver.outputs.cache-hit != 'true'
27+
run: |
28+
wget https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz
29+
tar xvzf linuxx64_odbc_cli.tar.gz
30+
- name: Setup PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{matrix.version}}
34+
- name: phpize
35+
run: phpize
36+
- name: configure
37+
run: ./configure --with-IBM_DB2=$PWD/clidriver
38+
- name: make
39+
run: make V=1
40+
# XXX: No tests until DB2 Docker container is set up (see Travis)
41+
#- name: Test dbase
42+
# run: make test TESTS=tests
43+
windows:
44+
defaults:
45+
run:
46+
shell: cmd
47+
strategy:
48+
matrix:
49+
version: ["7.3", "7.4", "8.0", "8.1"]
50+
arch: [x64]
51+
ts: [ts]
52+
runs-on: windows-latest
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v2
56+
- name: Cache DB2 library
57+
id: cache-clidriver
58+
uses: actions/cache@v2
59+
with:
60+
path: clidriver
61+
key: ${{ runner.os }}-clidriver
62+
- name: Install DB2 library
63+
if: steps.cache-clidriver.outputs.cache-hit != 'true'
64+
shell: pwsh
65+
run: |
66+
Invoke-WebRequest -Uri 'https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/ntx64_odbc_cli.zip' -OutFile 'ntx64_odbc_cli.zip'
67+
Expand-Archive 'ntx64_odbc_cli.zip' -DestinationPath '.\'
68+
- name: Setup PHP
69+
id: setup-php
70+
uses: cmb69/[email protected]
71+
with:
72+
version: ${{matrix.version}}
73+
arch: ${{matrix.arch}}
74+
ts: ${{matrix.ts}}
75+
- name: Enable Developer Command Prompt
76+
uses: ilammy/msvc-dev-cmd@v1
77+
with:
78+
arch: ${{matrix.arch}}
79+
toolset: ${{steps.setup-php.outputs.toolset}}
80+
- name: phpize
81+
run: phpize
82+
- name: configure
83+
run: configure --with-ibm_db2=%cd%\clidriver --with-prefix=${{steps.setup-php.outputs.prefix}}
84+
- name: make
85+
run: nmake
86+
# XXX: Can we run Docker containers in a Windows runner? That'll be required for tests
87+
#- name: test
88+
# run: nmake test TESTS=tests

0 commit comments

Comments
 (0)