Skip to content

updated ci

updated ci #31

Workflow file for this run

name: build
on:
push:
branches: [main]
paths:
- .github/**
- src/**
- test/**
- Makefile
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
- os: windows-latest
- os: macos-latest
arch: amd64
- os: macos-latest
arch: arm64
steps:
- uses: actions/checkout@v4
- name: Install dependencies on Linux
if: matrix.os == 'ubuntu-20.04'
run: sudo apt-get install -y sqlite3 gcc unzip
- name: Install dependencies on Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
choco install -y mingw
choco install -y unzip
choco install -y sqlite
- name: Install dependencies on macOS
if: matrix.os == 'macos-latest'
run: |
brew install unzip
brew install sqlite
brew link sqlite --force
- name: Download and prepare sources
run: |
make prepare-dist
make download-sqlite
- name: Compile and test on Linux
if: matrix.os == 'ubuntu-20.04'
run: |
make compile-linux
make test-all
- name: Compile and test on Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
make compile-windows
Write-Host "Running json_equal tests..."
Get-Content test/json_equal.sql | sqlite3.exe | Out-File -FilePath test.log
if (Select-String -Path test.log -Pattern '^[0-9_]+.[^1]$') { throw 'Test failed' }
Write-Host "json_equal tests completed successfully."
Write-Host "Running regexp tests..."
Get-Content test/regexp.sql | sqlite3.exe | Out-File -FilePath test.log
if (Select-String -Path test.log -Pattern '^[0-9_]+.[^1]$') { throw 'Test failed' }
Write-Host "regexp tests completed successfully."
Write-Host "Running split_part tests..."
Get-Content test/split_part.sql | sqlite3.exe | Out-File -FilePath test.log
if (Select-String -Path test.log -Pattern '^[0-9_]+.[^1]$') { throw 'Test failed' }
Write-Host "split_part tests completed successfully."
- name: Compile and test on macOS
if: matrix.os == 'macos-latest'
run: |
make compile-macos-universal
make test-all