Sqlite 04 #123
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Uro Development x86_64 | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: | |
image: hexpm/elixir:1.16.2-erlang-24.3.4.17-ubuntu-focal-20240216 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install system dependencies | |
run: | | |
apt update | |
apt install -y build-essential erlang-dev curl git libclang1 | |
- name: Set up Elixir | |
run: | | |
mix local.hex --force | |
mix local.rebar --force | |
- name: Restore dependencies cache | |
uses: actions/cache@v2 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-deps-${{ hashFiles('mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix-deps- | |
- name: Install CockroachDB | |
run: | | |
curl -s https://binaries.cockroachdb.com/cockroach-v23.2.0-rc.1.linux-amd64.tgz | tar xvz | |
mkdir -p ${{ runner.temp }}/cockroach | |
cp cockroach-v23.2.0-rc.1.linux-amd64/cockroach ${{ runner.temp }}/cockroach/ | |
echo "${{ runner.temp }}/cockroach" >> $GITHUB_PATH | |
- name: Setup Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- 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: Install dependencies | |
run: mix deps.get | |
- name: Start CockroachDB | |
run: | | |
cockroach start-single-node --insecure --background | |
- name: Wait for CockroachDB to be ready | |
run: | | |
until cockroach sql --execute="SELECT 1" --insecure; do sleep 1; done | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Compile code | |
run: mix compile | |
- 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_sqlite | |
run: | | |
set -e | |
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 sqlite fdb test results | |
continue-on-error: true | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-results | |
path: test_output_sqlite.txt | |
- name: Check formatted code | |
run: mix format --check-formatted |