Skip to content

Rename Client to Pgsql and expose connect as free function #72

Rename Client to Pgsql and expose connect as free function

Rename Client to Pgsql and expose connect as free function #72

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Disable auto CRLF
if: runner.os == 'Windows'
run: git config --global core.autocrlf false
- name: Checkout code
uses: actions/checkout@v6
# --- Cache MoonBit toolchain ---
- name: Cache MoonBit toolchain (Unix)
if: runner.os != 'Windows'
uses: actions/cache@v4
with:
path: ~/.moon
key: moonbit-${{ runner.os }}-${{ hashFiles('moon.mod.json') }}
restore-keys: moonbit-${{ runner.os }}-
- name: Cache MoonBit toolchain (Windows)
if: runner.os == 'Windows'
uses: actions/cache@v4
with:
path: ~\.moon
key: moonbit-${{ runner.os }}-${{ hashFiles('moon.mod.json') }}
restore-keys: moonbit-${{ runner.os }}-
# --- Cache mooncakes dependencies ---
- name: Cache mooncakes
uses: actions/cache@v4
with:
path: .mooncakes
key: mooncakes-${{ runner.os }}-${{ hashFiles('moon.mod.json') }}
restore-keys: mooncakes-${{ runner.os }}-
# --- Install MoonBit ---
- name: Set up MoonBit (Unix)
if: runner.os != 'Windows'
run: |
curl -fsSL https://cli.moonbitlang.com/install/unix.sh | bash
echo "$HOME/.moon/bin" >> $GITHUB_PATH
- name: Setup MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Set up MoonBit (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm https://cli.moonbitlang.com/install/powershell.ps1 | iex
"$env:USERPROFILE\.moon\bin" | Out-File -Append -FilePath $env:GITHUB_PATH
- name: Install dependencies
run: |
moon version --all
moon update
- name: Build
run: moon build --target native
- name: Unit tests
run: moon test --target native -p bikallem/pgsql
# --- Integration tests ---
- name: Setup PostgreSQL
uses: ikalnytskyi/action-setup-postgres@v7
with:
username: postgres
password: postgres
database: postgres
port: 5433
ssl: true
- name: Integration tests
run: moon test --target native src/tests/