Skip to content

Commit b276ac0

Browse files
authored
Fix macOS CI after GH runners & Homebrew both changed for the worse (#150)
* Try some fixes for the macOS CI and add some debug lines * Of course it'd be PHP that wants libpq... Because of COURSE it is! * Silly committing person forgot postgresql@11 doesn't get brew linked automatically * PostgreSQL formulae in Brew no longer run initdb if they detect CI (why). Also compensate for disjoint data directories. * Since we reinstall postgres 12 after uninstall, have to manually wipe the old data dir... * Runner won't let me rm -rf, let's see if it knows find -delete * Okay let's try bash-ing it. * Too syntactically weird for the workflow syntax, try more quoting... * Bash pipelines. Sigh. * Clean up after all the experiments, darn GH runners
1 parent 2df7722 commit b276ac0

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.github/workflows/test.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@ jobs:
77
fail-fast: false
88
matrix:
99
psql: ['postgresql@11', 'postgresql@12']
10+
include:
11+
# The PostgreSQL formulas don't use a consistent data dir
12+
- psql: 'postgresql@11'
13+
dbroot: '/usr/local/var/postgresql@11'
14+
- psql: 'postgresql@12'
15+
dbroot: '/usr/local/var/postgres'
1016
runs-on: macos-latest
1117
steps:
1218
- run: sudo xcode-select -s /Applications/Xcode_11.4.app/Contents/Developer
13-
- run: brew unlink libpq
19+
- run: brew uninstall --force libpq postgresql@11 postgresql@12 php
1420
- run: brew install ${{ matrix.psql }}
15-
continue-on-error: true
16-
- run: brew link -f --overwrite ${{ matrix.psql }}
17-
- run: brew reinstall ${{ matrix.psql }}
18-
- run: brew postinstall ${{ matrix.psql }}
21+
- run: brew link --force ${{ matrix.psql }}
22+
- run: bash -c '[[ -d "${{ matrix.dbroot }}" ]] && mv "${{ matrix.dbroot }}" /usr/local/var/.outta-the-way || true'
23+
- run: mkdir -p /usr/local/var/log "${{ matrix.dbroot }}"
24+
- run: initdb --locale=C -E UTF-8 "${{ matrix.dbroot }}"
1925
- run: brew services start ${{ matrix.psql }}
2026
- run: sleep 4 # give the server a chance to settle
2127
- run: createuser -d -l -s vapor_username

0 commit comments

Comments
 (0)