Skip to content
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

Add the m1 runners to CI + minor updates for the workflow #52

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,26 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
os: [ubuntu-latest, macos-latest, macos-14, windows-2019]
features: [default, bundled, buildtime_bindgen]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache cargo registry
uses: actions/cache@v3
uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}

- name: Set environment variables
shell: bash
run: |
echo "RUSTFLAGS=-D warnings" >> $GITHUB_ENV
echo "RUSTDOCFLAGS=-D warnings" >> $GITHUB_ENV
echo "BINDGEN_EXTRA_CLANG_ARGS=-I./pq-src/source/src/interfaces/libpq/ -I./pq-src/source/src/include/ -I ./pq-src/additional_include" >> $GITHUB_ENV

- name: Install postgres (Linux)
if: runner.os == 'Linux' && matrix.features == 'default'
run: |
Expand All @@ -45,13 +44,21 @@ jobs:
sudo service postgresql restart && sleep 3

- name: Install postgres (MacOS)
if: runner.os == 'macOS' && matrix.features == 'default'
if: matrix.os == 'macos-latest' && matrix.features != 'bundled'
run: |
initdb -D /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres start
sleep 3
createuser -s postgres

- name: Install postgres (MacOS M1)
if: matrix.os == 'macos-14' && matrix.features != 'bundled'
run: |
brew install postgresql
brew services start postgresql@14
sleep 3
createuser -s postgres

- name: Install postgres (Windows)
if: runner.os == 'Windows' && matrix.features != 'bundled'
shell: bash
Expand All @@ -61,25 +68,14 @@ jobs:
echo "C:\Program Files\PostgreSQL\12\lib" >> $GITHUB_PATH
echo "PQ_LIB_DIR=C:\Program Files\PostgreSQL\12\lib" >> $GITHUB_ENV

# - name: Add msbuild to PATH
# if: runner.os == 'Windows' && matrix.features == 'bundled'
# uses: microsoft/setup-msbuild@v1.3
# with:
# msbuild-architecture: x64
# - uses: ilammy/msvc-dev-cmd@v1
# if: runner.os == 'Windows' && matrix.features == 'bundled'

- name: Windows setup (bundled)
if: runner.os == 'Windows' && matrix.features == 'bundled'
shell: bash
run: |
echo "OPENSSL_RUST_USE_NASM=0" >> $GITHUB_ENV
echo OPENSSL_SRC_PERL=C:/Strawberry/perl/bin/perl >> $GITHUB_ENV
# - name: Windows setup (bundled)
# if: runner.os == 'Windows' && matrix.features == 'bundled'
# shell: cmd
# run: |
# cd pq-src/source/
# src\tools\msvc\build.bat libpq

- name: Install rust toolchain
uses: dtolnay/rust-toolchain@stable

Expand Down
Loading