-
-
Notifications
You must be signed in to change notification settings - Fork 22
128 lines (104 loc) · 3.89 KB
/
test.yml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Build and test
on: [push, pull_request]
jobs:
win64:
name: Test on Windows 64
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install latests rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-pc-windows-msvc
default: true
override: true
# Extract all files from installer
- name: Install SQLite drivers
run: |
Invoke-WebRequest http://www.ch-werner.de/sqliteodbc/sqliteodbc_w64.exe -OutFile C:\sqliteodbc.exe
7z x C:\sqliteodbc.exe -o"C:\Program Files\SQLite ODBC Driver for Win64"
REG ADD "HKLM\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" /v "SQLite3 ODBC Driver" /t REG_SZ /d Installed /f
REG ADD "HKLM\SOFTWARE\ODBC\ODBCINST.INI\SQLite3 ODBC Driver" /v "Driver" /t REG_SZ /d "C:\Program Files\SQLite ODBC Driver for Win64\sqlite3odbc.dll" /f
REG ADD "HKLM\SOFTWARE\ODBC\ODBCINST.INI\SQLite3 ODBC Driver" /v "Setup" /t REG_SZ /d "C:\Program Files\SQLite ODBC Driver for Win64\sqlite3odbc.dll" /f
REG ADD "HKLM\SOFTWARE\ODBC\ODBCINST.INI\SQLite3 ODBC Driver" /v "UsageCount" /t REG_DWORD /d 1
# selecting a toolchain either by action or manual `rustup` calls should happen
# before the plugin, as the cache uses the current rustc version as its cache key
- name: Rust build cache
uses: Swatinem/rust-cache@v2
- name: Test
run: |
cargo test --lib --features derive -- --skip postgresql --skip maria_db --skip microsoft_sql_server
cargo test --lib --features narrow,derive -- --skip postgresql --skip maria_db --skip microsoft_sql_server
win32:
name: Build Win32
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install latests rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: i686-pc-windows-msvc
default: true
override: true
# selecting a toolchain either by action or manual `rustup` calls should happen
# before the plugin, as the cache uses the current rustc version as its cache key
- name: Rust build cache
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release
osx:
name: Build OS-X
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install unixODBC
run: brew install unixodbc
- name: Install latests rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
override: true
- name: Build
run: cargo build --release
linux:
name: Build & Test Linux
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build test container
run: docker compose --file docker-compose-ci.yml build test_linux
- name: Test
run: docker compose --file docker-compose-ci.yml run test_linux
odbc_3_5:
name: Check build with ODBC 3.5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
cd ..
cargo new test-compilation
cd test-compilation
cargo add odbc-api --path ../odbc-api/odbc-api --no-default-features --features odbc_version_3_5
cargo build
dependabot:
needs: [linux,win64,osx,win32]
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}}
steps:
- name: Merge Depenabot Pull Request
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}