updated ci #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: [windows-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 | |
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' } | |
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' } | |
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' } | |
- name: Compile and test on macOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
make compile-macos | |
make test-all |