-
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (77 loc) · 2.87 KB
/
build.yml
File metadata and controls
90 lines (77 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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-latest
- 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-latest'
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-latest'
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 aws_policy_equal tests..."
Get-Content test/aws_policy_equal.sql | sqlite3.exe | Out-File -FilePath test.log
if (Select-String -Path test.log -Pattern '^[0-9_]+.[^1]$') { throw 'Test failed' }
Write-Host "aws_policy_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