Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Postgres step in CI. #62

Merged
merged 2 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
branches:
- "*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
Expand All @@ -29,3 +33,35 @@ jobs:
- name: Build on Rust ${{ matrix.toolchain }}
run: |
cargo build --verbose --color always
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Install Rust ${{ matrix.toolchain }} toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Run tests
run: |
cargo test --verbose --color always -- --show-output
env:
RAPID_GOSSIP_TEST_DB_HOST: localhost
RAPID_GOSSIP_TEST_DB_NAME: postgres
RAPID_GOSSIP_TEST_DB_USER: postgres
RAPID_GOSSIP_TEST_DB_PASSWORD: postgres
RAPID_GOSSIP_SYNC_SERVER_LOG_LEVEL: gossip
1 change: 1 addition & 0 deletions src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ impl SchemaSanitizer {
fn new() -> Self {
IS_TEST_SCHEMA_CLEAN.with(|cleanliness_reference| {
let mut is_clean_option = cleanliness_reference.borrow_mut();
assert!(is_clean_option.is_none());
*is_clean_option = Some(false);
});

Expand Down
Loading