diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74390eebd..d8e9b268a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,13 @@ on: - .cirrus.yml - .github/workflows/codeql.yml - appveyor.yml + workflow_dispatch: + inputs: + enable_ssh: + type: boolean + description: 'Enable ssh server before running the job' + required: false + default: false jobs: build: @@ -32,7 +39,7 @@ jobs: # Note: the jobs are ordered in the order of decreasing running # time, as this should minimize the total run-time of all jobs. - backend: postgresql - runner: macos-12 + runner: macos-14 name: PostgreSQL macOS - backend: oracle name: Oracle 11 @@ -50,7 +57,7 @@ jobs: - backend: mysql name: MySQL - backend: sqlite3 - runner: macos-12 + runner: macos-14 name: SQLite3 macOS - backend: sqlite3 name: SQLite3 C++17 @@ -58,7 +65,7 @@ jobs: - backend: sqlite3 name: SQLite3 - backend: empty - runner: macos-12 + runner: macos-14 name: Empty macOS - backend: empty name: Empty @@ -116,7 +123,7 @@ jobs: ;; macOS) - set_env_var PGDATA /usr/local/var/postgres + set_env_var PGDATA /opt/homebrew/var/postgresql@14 ;; esac @@ -141,8 +148,11 @@ jobs: set_env_var BUILD_EXAMPLES YES fi - - name: Install dependencies under Linux - if: runner.os == 'Linux' + - name: Setup tmate + uses: mxschmitt/action-tmate@v3 + if: ${{ github.event_name == 'workflow_dispatch' && inputs.enable_ssh }} + + - name: Install dependencies run: ./scripts/ci/install.sh - name: Prepare for build diff --git a/scripts/ci/before_build_postgresql.sh b/scripts/ci/before_build_postgresql.sh index b588c2471..98e893e3d 100755 --- a/scripts/ci/before_build_postgresql.sh +++ b/scripts/ci/before_build_postgresql.sh @@ -13,7 +13,6 @@ case "$(uname)" in ;; Darwin) - pg_ctl init pg_ctl start pg_isready --timeout=60 createuser --superuser postgres diff --git a/scripts/ci/install.sh b/scripts/ci/install.sh index e33d717fb..41166e4fc 100755 --- a/scripts/ci/install.sh +++ b/scripts/ci/install.sh @@ -52,6 +52,19 @@ case "$(uname)" in FreeBSD) pkg install -q -y bash cmake ;; + + Darwin) + case "${SOCI_CI_BACKEND}" in + postgresql) + brew install postgresql + ;; + esac + ;; + + *) + echo "Unknown platform: $(uname)" + exit 1 + ;; esac install_script="${SOCI_SOURCE_DIR}/scripts/ci/install_${SOCI_CI_BACKEND}.sh"