mirror of
https://github.com/getml/sqlgen.git
synced 2025-12-31 14:39:31 -06:00
Added a Github Actions pipeline for Windows (#5)
This commit is contained in:
committed by
GitHub
parent
c88d70dd85
commit
ea7a1fe8e0
36
.github/workflows/windows-postgres-cxx20.yaml
vendored
Normal file
36
.github/workflows/windows-postgres-cxx20.yaml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: windows-postgres-cxx20
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, closed]
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
|
||||
|
||||
jobs:
|
||||
windows-msvc:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
- name: Export GitHub Actions cache environment variables
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
- uses: lukka/run-vcpkg@v11
|
||||
- name: Compile
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=20 -DSQLGEN_BUILD_TESTS=ON -DSQLGEN_SQLITE3=OFF -DSQLGEN_BUILD_DRY_TESTS_ONLY=ON
|
||||
cmake --build build --config Release -j4
|
||||
- name: Run tests
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure
|
||||
36
.github/workflows/windows-sqlite-cxx20.yaml
vendored
Normal file
36
.github/workflows/windows-sqlite-cxx20.yaml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: windows-sqlite-cxx20
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, closed]
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
env:
|
||||
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
|
||||
|
||||
jobs:
|
||||
windows-msvc:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
- name: Export GitHub Actions cache environment variables
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
- uses: lukka/run-vcpkg@v11
|
||||
- name: Compile
|
||||
run: |
|
||||
cmake -S . -B build -G Ninja -DCMAKE_CXX_STANDARD=20 -DSQLGEN_BUILD_TESTS=ON -DSQLGEN_POSTGRES=OFF
|
||||
cmake --build build --config Release -j4
|
||||
- name: Run tests
|
||||
run: |
|
||||
ctest --test-dir build --output-on-failure
|
||||
@@ -76,6 +76,7 @@ Result<Nothing> Connection::insert(
|
||||
const auto& d = _data[i];
|
||||
|
||||
if (d.size() != current_row.size()) {
|
||||
execute("DEALLOCATE sqlgen_insert_into_table;");
|
||||
return error("Error in entry " + std::to_string(i) + ": Expected " +
|
||||
std::to_string(current_row.size()) + " entries, got " +
|
||||
std::to_string(d.size()));
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#ifndef SQLGEN_BUILD_DRY_TESTS_ONLY
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <rfl.hpp>
|
||||
@@ -47,3 +49,5 @@ TEST(postgres, test_insert_and_read) {
|
||||
}
|
||||
|
||||
} // namespace test_insert_and_read
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#ifndef SQLGEN_BUILD_DRY_TESTS_ONLY
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <rfl.hpp>
|
||||
@@ -60,3 +62,5 @@ TEST(postgres, test_insert_and_read_two_tables) {
|
||||
}
|
||||
|
||||
} // namespace test_insert_and_read_two_tables
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#ifndef SQLGEN_BUILD_DRY_TESTS_ONLY
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <rfl.hpp>
|
||||
@@ -6,7 +8,7 @@
|
||||
#include <sqlgen/postgres.hpp>
|
||||
#include <vector>
|
||||
|
||||
namespace test_update {
|
||||
namespace test_transaction {
|
||||
|
||||
struct Person {
|
||||
sqlgen::PrimaryKey<uint32_t> id;
|
||||
@@ -59,4 +61,6 @@ TEST(postgres, test_transaction) {
|
||||
EXPECT_EQ(rfl::json::write(people2), expected);
|
||||
}
|
||||
|
||||
} // namespace test_update
|
||||
} // namespace test_transaction
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user