mirror of
https://github.com/fluencelabs/sqlite-wasm-connector
synced 2025-03-14 22:10:49 +00:00
chore: Add to e2e (#12)
This commit is contained in:
parent
86743b28c1
commit
ceb9eb5468
2
.cargo/config.toml
Normal file
2
.cargo/config.toml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[registries]
|
||||||
|
fluence = { index = "git://crates.fluence.dev/index" }
|
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: ci
|
name: "ci"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@ -14,30 +14,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
name: "cargo test"
|
name: "Run tests"
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/tests.yml
|
||||||
timeout-minutes: 60
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Setup Rust toolchain
|
|
||||||
uses: actions-rust-lang/setup-rust-toolchain@v1
|
|
||||||
|
|
||||||
- name: Install marine
|
|
||||||
uses: baptiste0928/cargo-install@v1.3.0
|
|
||||||
with:
|
with:
|
||||||
crate: marine
|
ref: ${{ github.ref }}
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: ./build.sh
|
|
||||||
|
|
||||||
- name: Run cargo test
|
|
||||||
run: cargo test --release --all-features
|
|
||||||
|
|
||||||
- name: Run cargo fmt
|
|
||||||
run: cargo fmt --all -- --check
|
|
||||||
|
|
||||||
# - name: Run cargo clippy
|
|
||||||
# run: cargo clippy --all --all-features
|
|
||||||
|
77
.github/workflows/e2e.yml
vendored
Normal file
77
.github/workflows/e2e.yml
vendored
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
name: "e2e"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- "**.md"
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
snapshot:
|
||||||
|
name: "sqlite-wasm"
|
||||||
|
uses: ./.github/workflows/snapshot.yml
|
||||||
|
with:
|
||||||
|
ref: ${{ github.ref }}
|
||||||
|
|
||||||
|
registry:
|
||||||
|
needs:
|
||||||
|
- snapshot
|
||||||
|
uses: fluencelabs/registry/.github/workflows/tests.yml@main
|
||||||
|
with:
|
||||||
|
cargo-dependencies: |
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"package": "marine-sqlite-connector",
|
||||||
|
"version": "=${{ needs.snapshot.outputs.version }}",
|
||||||
|
"registry": "fluence"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
spell:
|
||||||
|
needs:
|
||||||
|
- snapshot
|
||||||
|
uses: fluencelabs/spell/.github/workflows/snapshot.yml@main
|
||||||
|
with:
|
||||||
|
cargo-dependencies: |
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"package": "marine-sqlite-connector",
|
||||||
|
"version": "=${{ needs.snapshot.outputs.version }}",
|
||||||
|
"registry": "fluence"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
rust-peer:
|
||||||
|
needs:
|
||||||
|
- spell
|
||||||
|
|
||||||
|
uses: fluencelabs/rust-peer/.github/workflows/snapshot.yml@master
|
||||||
|
with:
|
||||||
|
image-name: "docker.fluence.dev/sqlite-wasm-connector"
|
||||||
|
cargo-dependencies: |
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"package": "fluence-spell-dtos",
|
||||||
|
"version": "=${{ needs.spell.outputs.cargo-version }}",
|
||||||
|
"registry": "fluence"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"package": "fluence-spell-distro",
|
||||||
|
"version": "=${{ needs.spell.outputs.cargo-version }}",
|
||||||
|
"registry": "fluence"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
spell-aqua-tests:
|
||||||
|
name: "spell"
|
||||||
|
needs:
|
||||||
|
- rust-peer
|
||||||
|
uses: fluencelabs/spell/.github/workflows/tests.yml@main
|
||||||
|
with:
|
||||||
|
rust-peer-image: "${{ needs.rust-peer.outputs.rust-peer-image }}"
|
74
.github/workflows/snapshot.yml
vendored
Normal file
74
.github/workflows/snapshot.yml
vendored
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
name: Publish snapshots
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
ref:
|
||||||
|
description: "GitHub ref to checkout to"
|
||||||
|
type: string
|
||||||
|
default: "master"
|
||||||
|
outputs:
|
||||||
|
version:
|
||||||
|
description: "snapshot version"
|
||||||
|
value: ${{ jobs.snapshot.outputs.version }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
snapshot:
|
||||||
|
name: "Publish snapshot"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 60
|
||||||
|
|
||||||
|
outputs:
|
||||||
|
version: "${{ steps.snapshot.outputs.version }}"
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: fluencelabs/sqlite-wasm-connector
|
||||||
|
ref: ${{ inputs.ref }}
|
||||||
|
|
||||||
|
- name: Import secrets
|
||||||
|
uses: hashicorp/vault-action@v2.5.0
|
||||||
|
with:
|
||||||
|
url: https://vault.fluence.dev
|
||||||
|
path: jwt/github
|
||||||
|
role: ci
|
||||||
|
method: jwt
|
||||||
|
jwtGithubAudience: "https://github.com/fluencelabs"
|
||||||
|
jwtTtl: 300
|
||||||
|
exportToken: false
|
||||||
|
secrets: |
|
||||||
|
kv/cargo-registry/users/ci token | CARGO_REGISTRIES_FLUENCE_TOKEN
|
||||||
|
|
||||||
|
- name: Setup Rust toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
|
||||||
|
- name: Install marine
|
||||||
|
uses: baptiste0928/cargo-install@v1.3.0
|
||||||
|
with:
|
||||||
|
crate: marine
|
||||||
|
|
||||||
|
- name: Download sqlite-wasm
|
||||||
|
continue-on-error: true
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: sqlite-wasm
|
||||||
|
path: artifacts/
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: ./build.sh
|
||||||
|
|
||||||
|
- name: Generate snapshot version
|
||||||
|
id: version
|
||||||
|
uses: fluencelabs/github-actions/generate-snapshot-id@main
|
||||||
|
|
||||||
|
- name: Publish snapshot
|
||||||
|
id: snapshot
|
||||||
|
uses: fluencelabs/github-actions/cargo-publish-snapshot@main
|
||||||
|
with:
|
||||||
|
id: ${{ steps.version.outputs.id }}
|
49
.github/workflows/tests.yml
vendored
Normal file
49
.github/workflows/tests.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
name: Run tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
ref:
|
||||||
|
description: "git ref to checkout to"
|
||||||
|
type: string
|
||||||
|
default: "master"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
name: "cargo test"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 60
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: fluencelabs/sqlite-wasm-connector
|
||||||
|
ref: ${{ inputs.ref }}
|
||||||
|
|
||||||
|
- name: Setup Rust toolchain
|
||||||
|
uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||||
|
|
||||||
|
- name: Install marine
|
||||||
|
uses: baptiste0928/cargo-install@v1.3.0
|
||||||
|
with:
|
||||||
|
crate: marine
|
||||||
|
|
||||||
|
- name: Download sqlite-wasm
|
||||||
|
continue-on-error: true
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: sqlite-wasm
|
||||||
|
path: artifacts/
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: ./build.sh
|
||||||
|
|
||||||
|
- name: Run cargo test
|
||||||
|
run: cargo test --release --all-features
|
||||||
|
|
||||||
|
- name: Run cargo fmt
|
||||||
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
|
# - name: Run cargo clippy
|
||||||
|
# run: cargo clippy --all --all-features
|
@ -37,7 +37,7 @@ path = "src/test.rs"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
marine-rs-sdk = "0.7.0"
|
marine-rs-sdk = "0.7.0"
|
||||||
bytesize = "1.2.0"
|
bytesize = "1.1.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
marine-rs-sdk-test = "0.2.0"
|
marine-rs-sdk-test = "0.2.0"
|
||||||
|
7
build.sh
7
build.sh
@ -1,4 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
SQLITE_WASM_VERSION="v0.18.0_w"
|
||||||
|
|
||||||
set -o errexit -o nounset -o pipefail
|
set -o errexit -o nounset -o pipefail
|
||||||
|
|
||||||
# set current working directory to script directory to run script from everywhere
|
# set current working directory to script directory to run script from everywhere
|
||||||
@ -13,4 +16,6 @@ mkdir -p artifacts
|
|||||||
cp target/wasm32-wasi/release/test.wasm artifacts/
|
cp target/wasm32-wasi/release/test.wasm artifacts/
|
||||||
|
|
||||||
# download SQLite 3 to use in tests
|
# download SQLite 3 to use in tests
|
||||||
curl -L https://github.com/fluencelabs/sqlite/releases/download/v0.18.0_w/sqlite3.wasm -o artifacts/sqlite3.wasm
|
if [[ ! -f artifacts/sqlite3.wasm ]]; then
|
||||||
|
curl -L https://github.com/fluencelabs/sqlite/releases/download/${SQLITE_WASM_VERSION}/sqlite3.wasm -o artifacts/sqlite3.wasm
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user