Skip to content

Commit

Permalink
Update minimum rust version and build process (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
aljazerzen authored May 8, 2024
1 parent 1e76de9 commit b8ae118
Show file tree
Hide file tree
Showing 17 changed files with 348 additions and 133 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/publish-edgedb-client.yaml

This file was deleted.

25 changes: 14 additions & 11 deletions .github/workflows/publish-edgedb-derive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ jobs:
name: Test and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.65
default: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --package=edgedb-derive
# checkout and env setup
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build the nix shell
run: nix develop --command just --version
- uses: Swatinem/rust-cache@v2

# test
- name: Test
run: nix develop --command cargo test --all-features --package=edgedb-derive

# verify that git tag matches cargo version
- run: |
set -x
cargo_version="$(cargo metadata --format-version 1 \
Expand All @@ -29,4 +32,4 @@ jobs:
- working-directory: ./edgedb-derive
run: |
cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
25 changes: 14 additions & 11 deletions .github/workflows/publish-edgedb-errors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ jobs:
name: Test and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.65
default: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --package=edgedb-errors
# checkout and env setup
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build the nix shell
run: nix develop --command just --version
- uses: Swatinem/rust-cache@v2

# test
- name: Test
run: nix develop --command cargo test --all-features --package=edgedb-errors

# verify that git tag matches cargo version
- run: |
set -x
cargo_version="$(cargo metadata --format-version 1 \
Expand All @@ -29,4 +32,4 @@ jobs:
- working-directory: ./edgedb-errors
run: |
cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
25 changes: 14 additions & 11 deletions .github/workflows/publish-edgedb-protocol.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@ jobs:
name: Test and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.65
default: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --package=edgedb-protocol
# checkout and env setup
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build the nix shell
run: nix develop --command just --version
- uses: Swatinem/rust-cache@v2

# test
- name: Test
run: nix develop --command cargo test --all-features --package=edgedb-protocol

# verify that git tag matches cargo version
- run: |
set -x
cargo_version="$(cargo metadata --format-version 1 \
Expand All @@ -29,4 +32,4 @@ jobs:
- working-directory: ./edgedb-protocol
run: |
cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
26 changes: 14 additions & 12 deletions .github/workflows/publish-edgedb-tokio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ jobs:
name: Test and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: edgedb/setup-edgedb@v1.2.2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.65
default: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --package=edgedb-tokio
# checkout and env setup
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build the nix shell
run: nix develop --command just --version
- uses: Swatinem/rust-cache@v2

# test
- name: Test
run: nix develop --command cargo test --all-features --package=edgedb-tokio

# verify that git tag matches cargo version
- run: |
set -x
cargo_version="$(cargo metadata --format-version 1 \
Expand All @@ -30,4 +32,4 @@ jobs:
- working-directory: ./edgedb-tokio
run: |
cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}
53 changes: 0 additions & 53 deletions .github/workflows/rust.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on: [pull_request]

name: CI

jobs:
build_and_test:
name: Tests
runs-on: ubuntu-latest
strategy:
matrix:
rust_version: [default, minimum, beta]
timeout-minutes: 30
steps:
# checkout and env setup
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build the nix shell
run: nix develop .#${{ matrix.rust_version }} --command just --version
- uses: Swatinem/rust-cache@v2

# run tests
- name: Run tests
run: nix develop .#${{ matrix.rust_version }} --command just test
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ __pycache__
/.vscode

# nix stuff
/flake.nix
/flake.lock
/.envrc
/.direnv
16 changes: 16 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,19 @@ members = [
[profile.release]
debug = true
lto = true

[workspace.package]
rust-version = "1.72" # keep in sync with flake.nix

[workspace.lints.clippy]
useless_format = 'allow'
collapsible_if = 'allow'
derive_partial_eq_without_eq = 'allow'
zero_ptr = 'allow'
manual_strip = 'allow'
new_ret_no_self = 'allow'
type_complexity = 'allow'
vec_init_then_push = 'allow'
while_let_on_iterator = 'allow'
too_many_arguments = 'allow'
clone_on_copy = 'allow'
4 changes: 4 additions & 0 deletions edgedb-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description = """
Derive macros for EdgeDB database client.
"""
readme = "README.md"
rust-version.workspace = true

[dependencies]
syn = {version="2.0", features=["full"]}
Expand All @@ -23,3 +24,6 @@ serde_json = "1.0"

[lib]
proc-macro = true

[lints]
workspace = true
4 changes: 4 additions & 0 deletions edgedb-errors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ description = """
Error types for EdgeDB database client.
"""
readme = "README.md"
rust-version.workspace = true

[dependencies]
bytes = "1.0.1"
miette = { version = "7.2.0", optional = true }

[lib]

[lints]
workspace = true
5 changes: 4 additions & 1 deletion edgedb-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = """
Use edgedb-tokio for applications instead.
"""
readme = "README.md"
rust-version = "1.65"
rust-version.workspace = true

[dependencies]
bytes = "1.5.0"
Expand Down Expand Up @@ -38,3 +38,6 @@ test-case = "3.0.0"
humantime = "2.1.0"

[lib]

[lints]
workspace = true
4 changes: 4 additions & 0 deletions edgedb-tokio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ description = """
EdgeDB database client implementation for tokio.
"""
readme = "README.md"
rust-version.workspace = true

[dependencies]
edgedb-protocol = { path = "../edgedb-protocol", version = "0.6.0" }
Expand Down Expand Up @@ -72,3 +73,6 @@ admin_socket = ["dirs"]
unstable = ["serde_json", "tokio-stream"] # features for CLI and Wasm
fs = ["tokio/fs", "dirs", "serde_json"]
miette-errors = ["edgedb-errors/miette"]

[lints]
workspace = true
Loading

0 comments on commit b8ae118

Please sign in to comment.