Skip to content

Commit 101f339

Browse files
committed
Update ezsql-macos.yml
1 parent aca6691 commit 101f339

File tree

1 file changed

+85
-7
lines changed

1 file changed

+85
-7
lines changed

.github/workflows/ezsql-macos.yml

Lines changed: 85 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ jobs:
1313
windows:
1414
name: macOS (PHP ${{ matrix.php-versions }} CI)
1515
runs-on: macos-latest
16+
container:
17+
image: mcr.microsoft.com/mssql/server
18+
env:
19+
ACCEPT_EULA: y
20+
SA_PASSWORD: Password12!
21+
ports:
22+
- 1433:1433/tcp
23+
- 1434:1434/tcp
1624
strategy:
1725
fail-fast: false
1826
matrix:
@@ -52,14 +60,84 @@ jobs:
5260
createuser -s postgres
5361
psql -U postgres --command="CREATE USER ez_test PASSWORD 'ezTest'" --command="\du"
5462
createdb --owner=ez_test ez_test
55-
- name: Install Docker, and Docker Machine
63+
- name: "[Pre] Install Requirements"
64+
shell: bash
5665
run: |
57-
brew install docker docker-machine
58-
brew install virtualbox --cask
59-
brew services start docker-machine
60-
docker-machine create --driver virtualbox default
61-
eval $(docker-machine env default)
62-
docker-machine restart
66+
brew install coreutils
67+
brew install bash
68+
brew install socat
69+
70+
- name: "[Pre] Install Docker"
71+
shell: bash
72+
run: |
73+
brew install docker docker-machine-driver-xhyve
74+
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
75+
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
76+
while ! docker-machine create --driver xhyve default; do
77+
docker-machine rm -f default
78+
sleep 1;
79+
done
80+
# Export variable (this target)
81+
eval "$(docker-machine env default)"
82+
DOCKER_TLS_VERIFY="$( docker-machine env default | grep DOCKER_TLS_VERIFY | sed -e 's/.*="//g' -e 's/"$//g' )"
83+
DOCKER_HOST="$( docker-machine env default | grep DOCKER_HOST | sed -e 's/.*="//g' -e 's/"$//g' )"
84+
DOCKER_CERT_PATH="$( docker-machine env default | grep DOCKER_CERT_PATH | sed -e 's/.*="//g' -e 's/"$//g' )"
85+
DOCKER_MACHINE_NAME="$( docker-machine env default | grep DOCKER_MACHINE_NAME | sed -e 's/.*="//g' -e 's/"$//g' )"
86+
# Export variable (this other targets)
87+
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions#set-an-environment-variable-set-env
88+
echo ::set-env name=DOCKER_TLS_VERIFY::${DOCKER_TLS_VERIFY}
89+
echo ::set-env name=DOCKER_HOST::${DOCKER_HOST}
90+
echo ::set-env name=DOCKER_CERT_PATH::${DOCKER_CERT_PATH}
91+
echo ::set-env name=DOCKER_MACHINE_NAME::${DOCKER_MACHINE_NAME}
92+
# Show info
93+
docker-machine ls
94+
docker-machine env default
95+
docker version
96+
97+
- name: "[Pre] Install Docker Compose"
98+
shell: bash
99+
run: |
100+
sudo curl -L https://github.com/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
101+
sudo chmod +x /usr/local/bin/docker-compose
102+
docker-compose version
103+
104+
- name: "[Pre] Setup Docker machine"
105+
shell: bash
106+
run: |
107+
# Setup DNS records
108+
echo "127.0.0.1 localhost" | sudo tee -a /etc/hosts
109+
110+
# Portforwarding from DOCKER_HOST to local
111+
HOST="$( echo "${DOCKER_HOST}" | sed -e 's|^tcp://||g' -e 's|:.*||g' )"
112+
echo "${HOST}"
113+
sudo socat -s -d -d tcp-listen:80,reuseaddr,fork tcp:${HOST}:80 &
114+
sleep 2
115+
sudo socat -s -d -d tcp-listen:443,reuseaddr,fork tcp:${HOST}:443 &
116+
sleep 2
117+
if ! netstat -an | grep -i LISTEN | grep -E '(:80)|(\.80)\s'; then
118+
netstat -an | grep -i LISTEN;
119+
false;
120+
fi
121+
if ! netstat -an | grep -i LISTEN | grep -E '(:443)|(\.443)\s'; then
122+
netstat -an | grep -i LISTEN;
123+
false;
124+
fi
125+
host localhost
126+
curl -sS -I 'http://localhost:80' || true
127+
curl -sS -I 'https://localhost:443' || true
128+
129+
- name: "[Info] Show environment"
130+
shell: bash
131+
run: |
132+
env
133+
if: success() || failure()
134+
135+
- name: "[Info] Show network"
136+
shell: bash
137+
run: |
138+
netstat -an || true
139+
ss -tlun || true
140+
if: success() || failure()
63141
- name: Docker Install SQLServer
64142
run: |
65143
docker pull mcr.microsoft.com/mssql/server

0 commit comments

Comments
 (0)