Skip to content

updated ci

updated ci #18

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:
# os: [ubuntu-20.04, windows-latest, macos-latest]
os: [macos-latest]
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
sqlite3.exe -init test/inc/load_ext_windows.sql < test/json_equal.sql > test.log
if (Select-String -Path test.log -Pattern '^[0-9_]+.[^1]$') { throw 'Test failed' }
sqlite3.exe -init test/inc/load_ext_windows.sql < test/regexp.sql > test.log
if (Select-String -Path test.log -Pattern '^[0-9_]+.[^1]$') { throw 'Test failed' }
sqlite3.exe -init test/inc/load_ext_windows.sql < test/split_part.sql > test.log
if (Select-String -Path test.log -Pattern '^[0-9_]+.[^1]$') { throw 'Test failed' }
- name: Compile and test on macOS
if: matrix.os == 'macos-latest'
run: |
make compile-macos
sqlite3 --init test/inc/load_ext_darwin.sql
chmod +x dist/json_equal.dylib
chmod +x dist/regexp.dylib
chmod +x dist/split_part.dylib
make test-all