|
13 | 13 | matrix: |
14 | 14 | version: ['7.3', '7.4', '8.0', '8.1', '8.2'] |
15 | 15 | runs-on: ubuntu-latest |
| 16 | + services: |
| 17 | + ibm_db2: |
| 18 | + image: "icr.io/db2_community/db2:11.5.8.0" |
| 19 | + env: |
| 20 | + DB2INST1_PASSWORD: "password" |
| 21 | + LICENSE: "accept" |
| 22 | + DBNAME: "sample" |
| 23 | + options: "--privileged=true" |
| 24 | + ports: |
| 25 | + - "60000:50000" |
| 26 | + volumes: |
| 27 | + - database:/database |
16 | 28 | steps: |
17 | 29 | - name: Checkout |
18 | 30 | uses: actions/checkout@v3 |
|
50 | 62 | run: ./configure --with-IBM_DB2=$PWD/clidriver |
51 | 63 | - name: make |
52 | 64 | run: make V=1 |
53 | | - - name: Cache container |
54 | | - id: cache-docker |
55 | | - uses: actions/cache@v2 |
56 | | - with: |
57 | | - path: image-cache |
58 | | - key: ${{ runner.os }}-image-cache |
59 | | - - name: Download container |
60 | | - if: steps.cache-docker.outputs.cache-hit != 'true' |
61 | | - run: | |
62 | | - docker pull icr.io/db2_community/db2:11.5.8.0 |
63 | | - mkdir image-cache |
64 | | - docker save -o image-cache/db2.tar icr.io/db2_community/db2:11.5.8.0 |
65 | | - - name: Restore container from cache |
66 | | - if: steps.cache-docker.outputs.cache-hit == 'true' |
67 | | - run: docker load -i image-cache/db2.tar |
68 | 65 | - name: Set up Db2 LUW in Docker |
69 | | - # XXX: Should we be caching the Docker image? Are we creating the necessary things? |
70 | | - # Adapted from the Travis setup with the changes used for the current |
71 | | - # version of the Db2 container. |
72 | 66 | run: | |
73 | 67 | set -x |
74 | 68 | cat <<EOF > db2cli.ini |
|
79 | 73 | Database=sample |
80 | 74 | EOF |
81 | 75 | mkdir database |
82 | | - docker run --name db2 --privileged=true -p 60000:50000 -e DB2INST1_PASSWORD=password -e LICENSE=accept -e DBNAME=sample -v database:/database -itd icr.io/db2_community/db2:11.5.8.0 |
83 | | - docker ps -as |
84 | | - while true |
85 | | - do |
86 | | - if (docker logs db2 | grep 'Setup has completed') |
87 | | - then |
88 | | - break |
89 | | - fi |
90 | | - sleep 20 |
91 | | - done |
| 76 | + - name: "Perform healthcheck on db2 service" |
| 77 | + run: "docker logs -f ${{ job.services.ibm_db2.id }} | sed '/(*) Setup has completed./ q'" |
92 | 78 | - name: Tests |
93 | 79 | # make test is insufficient to load PDO |
94 | 80 | # Most of these are either cribbed from the old Travis configuration, |
|
0 commit comments