Skip to content

Commit

Permalink
foundationdb installation, update Rust setup, and adjust Elixir depen…
Browse files Browse the repository at this point in the history
…dencies
  • Loading branch information
fire committed Apr 29, 2024
1 parent 11c4211 commit 97474da
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 32 deletions.
68 changes: 36 additions & 32 deletions .github/workflows/uro_release_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ jobs:
apt update
apt install -y build-essential erlang-dev curl git libclang1
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Set up Elixir
run: |
mix local.hex --force
Expand All @@ -46,33 +40,29 @@ jobs:
cp cockroach-v23.2.0-rc.1.linux-amd64/cockroach ${{ runner.temp }}/cockroach/
echo "${{ runner.temp }}/cockroach" >> $GITHUB_PATH
- name: Install dependencies
run: mix deps.get
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Compile code
run: mix compile
- name: Install foundationdb dependency
run: |
set -e
curl -L https://github.com/apple/foundationdb/releases/download/7.1.53/foundationdb-clients_7.1.53-1_amd64.deb --output fdb-client.deb
dpkg -i fdb-client.deb
curl -L https://github.com/apple/foundationdb/releases/download/7.1.53/foundationdb-server_7.1.53-1_amd64.deb --output fdb-server.deb
dpkg -i fdb-server.deb
apt update && apt install -y libfuse3-dev execstack
- name: Install dependencies
run: mix deps.get

- name: Compile code
run: mix compile

- name: Run test sqlite
continue-on-error: true
id: test_step_sqlite
run: |
set -e
URO_DB_TYPE=sqlite MIX_ENV=test mix ecto.setup
URO_DB_TYPE=sqlite MIX_ENV=test mix run priv/repo/test_seeds.exs
URO_DB_TYPE=sqlite mix test | tee test_output_sqlite.txt
- name: Upload sqlite test results
continue-on-error: true
uses: actions/upload-artifact@v2
with:
name: test-results
path: test_output_sqlite.txt
- name: Install dependencies
run: mix deps.get

- name: Start CockroachDB
run: |
Expand All @@ -88,21 +78,35 @@ jobs:
- name: Compile code
run: mix compile

- name: Run tests postgres
- uses: actions/checkout@v2
with:
repository: V-Sekai/elixir-mvsqlite
path: elixir_mvsqlite

- run: cargo build --locked --release -p mvstore --manifest-path elixir_mvsqlite/rust_src/Cargo.toml

- name: Run test sqlite fdb
continue-on-error: true
id: test_step_postgres
id: test_step_sqlite
run: |
set -e
URO_DB_TYPE=postgresql MIX_ENV=test mix ecto.setup
URO_DB_TYPE=postgresql MIX_ENV=test mix run priv/repo/test_seeds.exs
URO_DB_TYPE=postgresql mix test | tee test_output_postgresql.txt; test ${PIPESTATUS[0]} -eq 0
chmod +x elixir_mvsqlite/rust_src/target/release/mvstore
export RUST_LOG=error
elixir_mvsqlite/rust_src/target/release/mvstore --data-plane 127.0.0.1:7000 --admin-api 127.0.0.1:7001 --metadata-prefix mvstore-test --raw-data-prefix m --auto-create-namespace --cluster /etc/foundationdb/fdb.cluster &
sleep 1
curl http://localhost:7001/api/create_namespace -d '{"key":"uro_dev.sqlite3","metadata":""}'
sleep 1
mix deps.get exqlite
URO_DB_TYPE=sqlite MIX_ENV=test mix ecto.setup
URO_DB_TYPE=sqlite MIX_ENV=test mix run priv/repo/test_seeds.exs
URO_DB_TYPE=sqlite mix test | tee test_output_sqlite.txt; test ${PIPESTATUS[0]} -eq 0
- name: Upload postgres test results
- name: Upload sqlite fdb test results
continue-on-error: true
uses: actions/upload-artifact@v2
with:
name: test-results
path: test_output_postgresql.txt
path: test_output_sqlite.txt

- name: Check formatted code
run: mix format --check-formatted
3 changes: 3 additions & 0 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ defmodule Uro.MixProject do
{:phoenix_swagger, "~> 0.8.3"},
{:ex_json_schema, "~> 0.7.4"},
{:remote_ip, "~> 1.0"},
{:ecto_sqlite3, "~> 0.13.0"},
{:exqlite,
[env: :prod, git: "https://github.com/V-Sekai/elixir-mvsqlite.git", override: true]},
{:waffle, "~> 1.1"},
{:waffle_ecto, "~> 0.0.10"},
{:swoosh, "~> 1.3"},
Expand Down

0 comments on commit 97474da

Please sign in to comment.