-
Notifications
You must be signed in to change notification settings - Fork 14
GitHub Actions CI #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
f1b5253
Use PHP 7.x style PDO include check
NattyNarwhal c278699
Initial GitHub Actions CI
NattyNarwhal addd471
Basic Windows support
NattyNarwhal 2374199
Only run CI on our main branch and PRs targeting it
NattyNarwhal f597c06
Attempt to work around that amd64 version of clidriver uses a differe…
NattyNarwhal baf74e0
Break up Ubuntu steps and use verbose make
NattyNarwhal 3a1b190
Don't have an empty globals on non-i
NattyNarwhal 97d68f9
Fix PDO include path when using modern m4 macro
NattyNarwhal 359efea
Attempt to run the Db2 container
NattyNarwhal a6bf66e
Attempt to fix loading PDO when running tests
NattyNarwhal a3d5671
Fix broken variable in PASE part of tests
NattyNarwhal 0d39d0e
Set PDO test variables as needed
NattyNarwhal 04496f3
Attempt to actually create the database
NattyNarwhal 9d8bc0b
Make options appendable in connection string
NattyNarwhal 2d0975e
Start test adaptations for PHP 8 and modern Db2
NattyNarwhal 959d7cd
The workstation name is the hostname
NattyNarwhal 213540a
We can't copy from a string to a stream
NattyNarwhal b13bee7
PDO changed error reporting message keys
NattyNarwhal deb1cda
Db2 has changed this message nowadays
NattyNarwhal 9b6effa
Replace the LUW version of the test with IBM i one
NattyNarwhal 8397c44
Attempt to cache the Docker container
NattyNarwhal a89356a
Trusted user context requires setup
NattyNarwhal 06dd54f
7.3 has been dropped from Windows support
NattyNarwhal ee10e48
Flip order of adding native_type/table
NattyNarwhal 9f6f201
Workaround: Disable the skip cache on PHP 8.1
NattyNarwhal f79f0dd
Fix crash if stream for LOB is null on 8.1
NattyNarwhal 617f25d
Suppress 8.1 deprecation message for NULL in PDO arg
NattyNarwhal 0c75465
Suppress 8.1 deprecation msg, fix indentation
NattyNarwhal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
name: Build and Test | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
# XXX: macOS | ||
ubuntu: | ||
strategy: | ||
matrix: | ||
version: ['7.3', '7.4', '8.0', '8.1'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Cache DB2 library | ||
id: cache-clidriver | ||
uses: actions/cache@v2 | ||
with: | ||
path: clidriver | ||
key: ${{ runner.os }}-clidriver | ||
- name: Install DB2 library | ||
if: steps.cache-clidriver.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/linuxx64_odbc_cli.tar.gz | ||
tar xvzf linuxx64_odbc_cli.tar.gz | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{matrix.version}} | ||
extensions: pdo | ||
- name: phpize | ||
run: phpize | ||
- name: configure | ||
run: ./configure --with-pdo-ibm=$PWD/clidriver | ||
- name: make | ||
run: make V=1 | ||
- name: Cache container | ||
id: cache-docker | ||
uses: actions/cache@v2 | ||
with: | ||
path: image-cache | ||
key: ${{ runner.os }}-image-cache | ||
- name: Download container | ||
if: steps.cache-docker.outputs.cache-hit != 'true' | ||
run: | | ||
docker pull ibmcom/db2 | ||
mkdir image-cache | ||
docker save -o image-cache/db2.tar ibmcom/db2 | ||
- name: Restore container from cache | ||
if: steps.cache-docker.outputs.cache-hit == 'true' | ||
run: docker load -i image-cache/db2.tar | ||
- name: Set up Db2 LUW in Docker | ||
# XXX: Should we be caching the Docker image? Are we creating the necessary things? | ||
# Adapted from the Travis setup with the changes used for the current | ||
# version of the Db2 container. | ||
run: | | ||
set -x | ||
cat <<EOF > db2cli.ini | ||
[SAMPLE] | ||
Hostname=localhost | ||
Protocol=TCPIP | ||
Port=60000 | ||
Database=sample | ||
EOF | ||
mkdir database | ||
docker run --name db2 --privileged=true -p 60000:50000 -e DB2INST1_PASSWORD=password -e LICENSE=accept -e DBNAME=sample -v database:/database -itd ibmcom/db2 | ||
docker ps -as | ||
while true | ||
do | ||
if (docker logs db2 | grep 'Setup has completed') | ||
then | ||
break | ||
fi | ||
sleep 20 | ||
done | ||
- name: Tests | ||
# make test is insufficient to load PDO | ||
# Most of these are either cribbed from the old Travis configuration, | ||
# or required for the tests to use the DSN. | ||
run: | | ||
export TEST_PHP_ARGS="-n -d extension=pdo.so -d extension=modules/pdo_ibm.so" | ||
export DISABLE_SKIP_CACHE=1 | ||
export IBM_DB2_TEST_SKIP_CONNECT_FAILURE=0 | ||
export DB2CLIINIPATH=$PWD | ||
export REPORT_EXIT_STATUS=1 | ||
export PDOTEST_DSN=ibm:DSN=SAMPLE | ||
export PDOTEST_USER=db2inst1 | ||
export PDOTEST_PASS=password | ||
php run-tests.php -P --show-diff tests | ||
windows: | ||
defaults: | ||
run: | ||
shell: cmd | ||
strategy: | ||
matrix: | ||
version: ["7.4", "8.0", "8.1"] | ||
arch: [x64] | ||
ts: [ts] | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Cache DB2 library | ||
id: cache-clidriver | ||
uses: actions/cache@v2 | ||
with: | ||
path: clidriver | ||
key: ${{ runner.os }}-clidriver | ||
- name: Install DB2 library | ||
if: steps.cache-clidriver.outputs.cache-hit != 'true' | ||
shell: pwsh | ||
run: | | ||
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' | ||
Expand-Archive 'ntx64_odbc_cli.zip' -DestinationPath '.\' | ||
- name: Setup PHP | ||
id: setup-php | ||
uses: cmb69/[email protected] | ||
with: | ||
version: ${{matrix.version}} | ||
arch: ${{matrix.arch}} | ||
ts: ${{matrix.ts}} | ||
- name: Enable Developer Command Prompt | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: ${{matrix.arch}} | ||
toolset: ${{steps.setup-php.outputs.toolset}} | ||
- name: phpize | ||
run: phpize | ||
- name: configure | ||
run: configure --with-pdo-ibm=%cd%\clidriver --with-prefix=${{steps.setup-php.outputs.prefix}} | ||
- name: make | ||
run: nmake | ||
# XXX: Can we run Docker containers in a Windows runner? That'll be required for tests | ||
#- name: test | ||
# run: nmake test TESTS=tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option would be to define a "uses globals" flag instead of hardcoding to PASE in case other platforms need it in the future, eg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a bad idea, but considering ibm_db2 went a long while without any non-PASE globals, might also be needless, yeah.