-
Notifications
You must be signed in to change notification settings - Fork 8
Use musl targets for static Linux binaries #237
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
Changes from all commits
85bd4ba
1ead111
ace4980
c7fbb87
e3edf21
0ec385f
02b3a2a
e438463
46b9be8
844ebbe
618c17f
748443f
ae893e1
bfe5edd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: Dependabot auto-merge | ||
| name: auto-merge | ||
| on: pull_request | ||
|
|
||
| permissions: | ||
|
|
||
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,269 @@ | ||||||||||||||||||||
| name: Compatibility tests | ||||||||||||||||||||
|
|
||||||||||||||||||||
| concurrency: | ||||||||||||||||||||
| group: ${{ github.workflow }}-${{ github.ref }} | ||||||||||||||||||||
| cancel-in-progress: true | ||||||||||||||||||||
|
|
||||||||||||||||||||
| on: | ||||||||||||||||||||
| push: | ||||||||||||||||||||
| branches: [ main ] | ||||||||||||||||||||
| workflow_dispatch: { } | ||||||||||||||||||||
| schedule: | ||||||||||||||||||||
| - cron: "0 0 * * *" # daily at midnight UTC | ||||||||||||||||||||
| workflow_run: | ||||||||||||||||||||
| workflows: ["Release"] | ||||||||||||||||||||
| types: | ||||||||||||||||||||
| - completed | ||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
| e2e: | ||||||||||||||||||||
| name: E2E tests with Node.js npm package | ||||||||||||||||||||
| runs-on: ${{ matrix.os }} | ||||||||||||||||||||
| # Skip this job for version bump commits (binary won't exist yet) | ||||||||||||||||||||
| if: "!contains(github.event.head_commit.message, 'Release')" | ||||||||||||||||||||
| strategy: | ||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||
| matrix: | ||||||||||||||||||||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||||||||||||||||||||
| db: | ||||||||||||||||||||
| - mysql: 8 | ||||||||||||||||||||
| - mysql: 5.7 | ||||||||||||||||||||
| - mysql: 5.6 | ||||||||||||||||||||
| - postgres: 16 | ||||||||||||||||||||
| - postgres: 15 | ||||||||||||||||||||
| - postgres: 14 | ||||||||||||||||||||
| - postgres: 13 | ||||||||||||||||||||
| - postgres: 12 | ||||||||||||||||||||
| # Only run database tests on ubuntu-latest to save CI time | ||||||||||||||||||||
| exclude: | ||||||||||||||||||||
| - os: macos-latest | ||||||||||||||||||||
| db: { mysql: 5.7 } | ||||||||||||||||||||
| - os: macos-latest | ||||||||||||||||||||
| db: { mysql: 5.6 } | ||||||||||||||||||||
| - os: macos-latest | ||||||||||||||||||||
| db: { postgres: 15 } | ||||||||||||||||||||
| - os: macos-latest | ||||||||||||||||||||
| db: { postgres: 14 } | ||||||||||||||||||||
| - os: macos-latest | ||||||||||||||||||||
| db: { postgres: 13 } | ||||||||||||||||||||
| - os: macos-latest | ||||||||||||||||||||
| db: { postgres: 12 } | ||||||||||||||||||||
| - os: windows-latest | ||||||||||||||||||||
| db: { mysql: 5.7 } | ||||||||||||||||||||
| - os: windows-latest | ||||||||||||||||||||
| db: { mysql: 5.6 } | ||||||||||||||||||||
| - os: windows-latest | ||||||||||||||||||||
| db: { postgres: 15 } | ||||||||||||||||||||
| - os: windows-latest | ||||||||||||||||||||
| db: { postgres: 14 } | ||||||||||||||||||||
| - os: windows-latest | ||||||||||||||||||||
| db: { postgres: 13 } | ||||||||||||||||||||
| - os: windows-latest | ||||||||||||||||||||
| db: { postgres: 12 } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout sources | ||||||||||||||||||||
| uses: actions/checkout@v3 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Setup Node.js 20 | ||||||||||||||||||||
| uses: actions/setup-node@v3 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| node-version: '20' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Build docker-compose services for integration tests (Linux only) | ||||||||||||||||||||
| if: runner.os == 'Linux' | ||||||||||||||||||||
| run: docker compose -f docker-compose.yml up -d | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| MYSQL_VERSION: ${{ matrix.db.mysql }} | ||||||||||||||||||||
| PG_VERSION: ${{ matrix.db.postgres }} | ||||||||||||||||||||
| MYSQL_MIGRATION_FILE: "${{ matrix.db.mysql == '5.6' && 'mysql_migration_5_6.sql' || 'mysql_migration.sql' }}" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Wait for databases to be ready (Linux only) | ||||||||||||||||||||
| if: runner.os == 'Linux' | ||||||||||||||||||||
| uses: GuillaumeFalourd/wait-sleep-action@v1 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| time: '10' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Check docker-compose services (Linux only) | ||||||||||||||||||||
| if: runner.os == 'Linux' | ||||||||||||||||||||
| run: docker ps -a | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install sqlx-ts from npm | ||||||||||||||||||||
| working-directory: ./node | ||||||||||||||||||||
| run: npm install | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Verify sqlx-ts installation | ||||||||||||||||||||
| working-directory: ./node | ||||||||||||||||||||
| shell: bash | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| ./sqlx-ts --version | ||||||||||||||||||||
| ./sqlx-ts --help | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Create test directory | ||||||||||||||||||||
| shell: bash | ||||||||||||||||||||
| run: mkdir -p tests/staging | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Add failure.ts test file (Linux only) | ||||||||||||||||||||
| if: runner.os == 'Linux' | ||||||||||||||||||||
| shell: bash | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| cat << 'EOF' > tests/staging/failure.ts | ||||||||||||||||||||
| import { sql } from 'sqlx-ts' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| const selectSql4 = sql` | ||||||||||||||||||||
| SELECT itemz.* | ||||||||||||||||||||
| FROM items; | ||||||||||||||||||||
| ` | ||||||||||||||||||||
| EOF | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run failure test (Linux only) | ||||||||||||||||||||
| if: runner.os == 'Linux' | ||||||||||||||||||||
| working-directory: ./node | ||||||||||||||||||||
| shell: bash | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| set +e | ||||||||||||||||||||
| ./sqlx-ts --config=../.sqlxrc.sample.json ../tests/staging | ||||||||||||||||||||
| EXIT_CODE=$? | ||||||||||||||||||||
| if [ $EXIT_CODE -eq 0 ]; then | ||||||||||||||||||||
| echo "Expected failure, but command succeeded." | ||||||||||||||||||||
| exit 1 | ||||||||||||||||||||
| fi | ||||||||||||||||||||
| echo "Command failed as expected with exit code $EXIT_CODE." | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Remove failure test file | ||||||||||||||||||||
| if: runner.os == 'Linux' | ||||||||||||||||||||
| shell: bash | ||||||||||||||||||||
| run: rm -f tests/staging/failure.ts | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Add happy.ts test file (Linux only) | ||||||||||||||||||||
| if: runner.os == 'Linux' | ||||||||||||||||||||
| shell: bash | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| cat << 'EOF' > tests/staging/happy.ts | ||||||||||||||||||||
| import { sql } from 'sqlx-ts' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| const selectSql4 = sql` | ||||||||||||||||||||
| SELECT items.* | ||||||||||||||||||||
| FROM items; | ||||||||||||||||||||
| ` | ||||||||||||||||||||
| EOF | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run happy test (Linux only) | ||||||||||||||||||||
| if: runner.os == 'Linux' | ||||||||||||||||||||
| working-directory: ./node | ||||||||||||||||||||
| shell: bash | ||||||||||||||||||||
| run: ./sqlx-ts --config=../.sqlxrc.sample.json ../tests/staging | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Test sqlx-ts on ${{ matrix.os }} (no database) | ||||||||||||||||||||
| if: runner.os != 'Linux' | ||||||||||||||||||||
| working-directory: ./node | ||||||||||||||||||||
| shell: bash | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| echo "✅ sqlx-ts successfully installed and runs on ${{ matrix.os }}" | ||||||||||||||||||||
| ./sqlx-ts --version | ||||||||||||||||||||
| ./sqlx-ts --help | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| e2e-linux-distros: | ||||||||||||||||||||
| name: E2E npm package on Linux distros with databases | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| # Skip this job for version bump commits (binary won't exist yet) | ||||||||||||||||||||
| if: "!contains(github.event.head_commit.message, 'Release')" | ||||||||||||||||||||
| strategy: | ||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||
| matrix: | ||||||||||||||||||||
| distro: | ||||||||||||||||||||
| - ubuntu:20.04 | ||||||||||||||||||||
| - ubuntu:22.04 | ||||||||||||||||||||
| - ubuntu:24.04 | ||||||||||||||||||||
| - debian:11 | ||||||||||||||||||||
| - debian:12 | ||||||||||||||||||||
| - alpine:3.18 | ||||||||||||||||||||
| - alpine:3.19 | ||||||||||||||||||||
| - fedora:38 | ||||||||||||||||||||
| - fedora:39 | ||||||||||||||||||||
| - archlinux:latest | ||||||||||||||||||||
| db: | ||||||||||||||||||||
| - mysql: 8 | ||||||||||||||||||||
| - postgres: 16 | ||||||||||||||||||||
| # Test fewer combinations to save CI time | ||||||||||||||||||||
| exclude: | ||||||||||||||||||||
| - distro: ubuntu:20.04 | ||||||||||||||||||||
| db: { postgres: 16 } | ||||||||||||||||||||
| - distro: ubuntu:22.04 | ||||||||||||||||||||
| db: { postgres: 16 } | ||||||||||||||||||||
| - distro: debian:11 | ||||||||||||||||||||
| db: { postgres: 16 } | ||||||||||||||||||||
| - distro: debian:12 | ||||||||||||||||||||
| db: { mysql: 8 } | ||||||||||||||||||||
| - distro: alpine:3.18 | ||||||||||||||||||||
| db: { postgres: 16 } | ||||||||||||||||||||
| - distro: alpine:3.19 | ||||||||||||||||||||
| db: { mysql: 8 } | ||||||||||||||||||||
| - distro: fedora:38 | ||||||||||||||||||||
| db: { postgres: 16 } | ||||||||||||||||||||
| - distro: fedora:39 | ||||||||||||||||||||
| db: { mysql: 8 } | ||||||||||||||||||||
|
|
||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout sources | ||||||||||||||||||||
| uses: actions/checkout@v3 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Build docker-compose services | ||||||||||||||||||||
| run: docker compose -f docker-compose.yml up -d | ||||||||||||||||||||
| env: | ||||||||||||||||||||
| MYSQL_VERSION: ${{ matrix.db.mysql }} | ||||||||||||||||||||
| PG_VERSION: ${{ matrix.db.postgres }} | ||||||||||||||||||||
| MYSQL_MIGRATION_FILE: "${{ matrix.db.mysql == '5.6' && 'mysql_migration_5_6.sql' || 'mysql_migration.sql' }}" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Wait for databases to be ready | ||||||||||||||||||||
| uses: GuillaumeFalourd/wait-sleep-action@v1 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| time: '10' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Create test file | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| mkdir -p tests/staging | ||||||||||||||||||||
| cat << 'TESTEOF' > tests/staging/distro-test.ts | ||||||||||||||||||||
| import { sql } from 'sqlx-ts' | ||||||||||||||||||||
|
|
||||||||||||||||||||
| const selectSql = sql` | ||||||||||||||||||||
| SELECT items.* | ||||||||||||||||||||
| FROM items; | ||||||||||||||||||||
| ` | ||||||||||||||||||||
| TESTEOF | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Test npm install and run in ${{ matrix.distro }} container | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| docker run --rm \ | ||||||||||||||||||||
| --network host \ | ||||||||||||||||||||
| -v $(pwd):/workspace \ | ||||||||||||||||||||
| -w /workspace \ | ||||||||||||||||||||
| ${{ matrix.distro }} sh -c ' | ||||||||||||||||||||
| # Install Node.js based on distro | ||||||||||||||||||||
| if command -v apk > /dev/null; then | ||||||||||||||||||||
| # Alpine | ||||||||||||||||||||
|
Comment on lines
+244
to
+245
|
||||||||||||||||||||
| if command -v apk > /dev/null; then | |
| # Alpine | |
| if [ -f /etc/os-release ] && grep -q '^ID=alpine' /etc/os-release; then | |
| # Alpine (detected via /etc/os-release) |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Arch Linux distro (archlinux:latest) in the matrix is not handled in the package manager detection logic. Add an elif branch to handle pacman for Arch Linux installations.
| dnf install -y nodejs npm | |
| dnf install -y nodejs npm | |
| elif command -v pacman > /dev/null; then | |
| # Arch Linux | |
| pacman -Sy --noconfirm nodejs npm bash |
Copilot
AI
Nov 24, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] For Fedora 38 and 39, the package manager should be dnf, but consider that Fedora 39 and later may have different Node.js versions in their repositories. You might want to use a consistent Node.js version across all distros by using NodeSource or nvm instead of relying on distro-provided packages.
| dnf install -y nodejs npm | |
| dnf install -y curl | |
| curl -fsSL https://rpm.nodesource.com/setup_20.x | bash - | |
| dnf install -y nodejs |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: Deploy docs/install-script to gh-pages branch for public use | ||
| name: gh-pages | ||
| on: | ||
| push: | ||
| branches: [main] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.